Create a Embedding
Converts input content into embedding vectors. Supports text, image URL/base64, and mixed lists.
Set the header 'Authorization: Bearer {your API key}' for authentication
In: header
Header Parameters
Request trace ID. You can pass a custom value to mark the request; if omitted, the platform generates one automatically. For troubleshooting, either this value or the x-siliconcloud-trace-id in the response header can be provided.
The W3C Trace Context standard tracing header. When present, the platform uses its trace-id part as the tracing identifier of the request.
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. For a complete list of available models, please check the Models.
"BAAI/bge-large-zh-v1.5"Input text to embed must be provided as a string or an array of tokens. To process multiple inputs in a single request, pass an array of strings or an array of token arrays. The input length must not exceed the model's maximum token limit and should not be an empty string. The maximum input tokens for each model are as follows:
BAAI/bge-large-zh-v1.5, BAAI/bge-large-en-v1.5, netease-youdao/bce-embedding-base_v1: 512 BAAI/bge-m3, Pro/BAAI/bge-m3: 8192 Qwen/Qwen3-Embedding-8B, Qwen/Qwen3-Embedding-4B, Qwen/Qwen3-Embedding-0.6B: 32768
"The format to return the embeddings in. Can be either float or base64 "
"float""float" | "base64""float"The number of dimensions the resulting output embeddings should have. Only supported in Qwen/Qwen3 series. - Qwen/Qwen3-Embedding-8B: [64,128,256,512,768,1024,1536,2048,2560,4096] - Qwen/Qwen3-Embedding-4B:[64,128,256,512,768,1024,1536,2048,2560] - Qwen/Qwen3-Embedding-0.6B: [64,128,256,512,768,1024]
1024The model name for VL Embedding. support models:Qwen/Qwen3-VL-Embedding-8B.
"Qwen/Qwen3-VL-Embedding-8B"Input content to be converted. Supported forms:
- A single string
- A content object (text or image)
- A mixed list (strings/content objects)
Notes:
- Text content object format:
{"text":"text to embed"} - Image content object format:
{"image":"https://example.com/image.jpg"}or base64 - Video content is not supported yet
- Input length must not exceed the model context limit and cannot be empty
Text content object.
Text content to be converted.
"The quick brown fox"Image content object.
Image URL or base64-encoded image content.
"https://example.com/image.jpg"A content list where each item can be a string, text object, or image object.
["First text",{"text":"Second text"},{"image":"https://example.com/image.jpg"}]Item: A single item in the embedding input list.
Output encoding format. Available values: float or base64.
"float""float" | "base64""float"The number of dimensions the resulting output embeddings should have. Only supported in Qwen/Qwen3 series. - Qwen/Qwen3-Embedding-8B: [64,128,256,512,768,1024,1536,2048,2560,4096] - Qwen/Qwen3-Embedding-4B:[64,128,256,512,768,1024,1536,2048,2560] - Qwen/Qwen3-Embedding-0.6B: [64,128,256,512,768,1024]
1024User identifier for request tracing and rate limiting.
"user_123"Truncation direction for overlong text. Available values: left or right.
"left" | "right""right"Response Headers
Request trace ID. The unique identifier for this request, useful for log lookup and troubleshooting. Generated by the platform when X-Trace-Id is not provided, and echoed back as-is when it is. When troubleshooting, either trace ID can be provided.
Response Body
The response from the model.
TypeScript Definitions
Use the response body type in TypeScript.
The object type, which is always "list".
"list"The name of the model used to generate the embedding.
The list of embeddings generated by the model.
The usage information for the request.
curl -X POST https://api.siliconflow.cn/v1/embeddings \
-H "Authorization: Bearer $SILICONFLOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "Hello, world!",
"model": "Qwen/Qwen3-VL-Embedding-8B"
}'
import requests
response = requests.post(
"https://api.siliconflow.cn/v1/embeddings",
headers={
"Authorization": "Bearer $SILICONFLOW_API_KEY",
"Content-Type": "application/json"
},
json={
"input": {"image": "https://example.com/image.jpg"},
"model": "Qwen/Qwen3-VL-Embedding-8B"
}
)
print(response.json())
curl -X POST https://api.siliconflow.cn/v1/embeddings \
-H "Authorization: Bearer $SILICONFLOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": [
"First text",
{"text": "Second text"},
{"image": "https://example.com/image.jpg"}
],
"model": "Qwen/Qwen3-VL-Embedding-8B",
"dimensions": 768
}'
{
"object": "list",
"model": "string",
"data": [
{
"object": "embedding",
"embedding": [
0
],
"index": 0
}
],
"usage": {
"prompt_tokens": 0,
"completion_tokens": 0,
"total_tokens": 0
}
}{
"code": 20012,
"message": "string",
"data": "string"
}"Invalid token""Forbidden""404 page not found"{
"message": "Request was rejected due to rate limiting. If you want more, please contact contact@siliconflow.cn. Details:TPM limit reached.",
"data": "string"
}{
"code": 50505,
"message": "Model service overloaded. Please try again later.",
"data": "string"
}"string"Create a System One decision request (TypeSafe) POST
[Alpha]Make yes/no judgments, option selections, or scoring assessments based on the given input, suited for quick decision scenarios. This API is still in a testing and validation stage; it may be adjusted or discontinued. Currently free of charge; if charging starts, it will be announced separately.
Create a Rerank POST
Reranks documents by relevance to a query. Supports text, image, and video content.