POST
/
embeddings

Authorizations

Authorization
string
headerrequired

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
model
enum<string>
required

The name of the embedding model to use.要使用的 embedding 模型名称。

Available options:
BAAI/bge-large-zh-v1.5,
BAAI/bge-large-en-v1.5,
netease-youdao/bce-embedding-base_v1,
BAAI/bge-m3,
Pro/BAAI/bge-m3
input
default: 硅基流动embedding上线,多快好省的 embedding 服务,快来试试吧required

Input text to embed, encoded as a string or array of tokens. To embed multiple inputs in a single request, pass an array of strings or array of token arrays. The input must not exceed the max input tokens for the model (512 tokens for all models except BAAI/bge-m3 which is 8192), cannot be an empty string. 输入的文本将被编码为字符串或 tokens 数组。要在单个请求中嵌入多个输入,请传递字符串数组或字符串数组。每个字符串不得超过模型的最大 tokens 限制(BAAI/bge-m3模型为8192tokens,其余模型为512tokens),且不能为空字符串。

encoding_format
enum<string>
default: float

"The format to return the embeddings in. Can be either float or base64. 返回嵌入的格式。可以是 float 或 base64."

Available options:
float,
base64

Response

200 - application/json
object
enum<string>
required

The object type, which is always "list".

model
string
required

The name of the model used to generate the embedding.

data
object[]
required

The list of embeddings generated by the model.

data.object
enum<string>
required
Available options:
embedding
data.embedding
number[]
required
data.index
integer
required
usage
object
required

The usage information for the request.

usage.prompt_tokens
integer
required

The number of tokens used by the prompt.

usage.completion_tokens
integer
required

The number of tokens used by the completion.

usage.total_tokens
integer
required

The total number of tokens used by the request.