POST
/
embeddings
curl --request POST \
  --url https://api.siliconflow.cn/v1/embeddings \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "BAAI/bge-large-zh-v1.5",
  "input": "Silicon flow embedding online: fast, affordable, and high-quality embedding services. come try it out!",
  "encoding_format": "float"
}'
{
  "model": "<string>",
  "data": [
    {
      "object": "embedding",
      "embedding": [
        123
      ],
      "index": 123
    }
  ],
  "usage": {
    "prompt_tokens": 123,
    "completion_tokens": 123,
    "total_tokens": 123
  }
}

Authorizations

Authorization
string
header
required

Use the following format for authentication: Bearer <your api key>

Body

application/json
model
enum<string>
required

Corresponding Model Name. To better enhance service quality, we will make periodic changes to the models provided by this service, including but not limited to model on/offlining and adjustments to model service capabilities. We will notify you of such changes through appropriate means such as announcements or message pushes where feasible.

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
Example:

"BAAI/bge-large-zh-v1.5"

input
default:Silicon flow embedding online: fast, affordable, and high-quality embedding services. come try it out!
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.

Example:

"Silicon flow embedding online: fast, affordable, and high-quality embedding services. come try it out!"

encoding_format
enum<string>
default:float

"The format to return the embeddings in. Can be either float or base64. "

Available options:
float,
base64
Example:

"float"

Response

200
application/json
200
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.

usage
object
required

The usage information for the request.