Overview
Generates vector representations (embeddings) of text or multimodal content for downstream tasks such as similarity calculation, retrieval, and classification.
API details
Constraints
- You must have an API key. For more information, see Manage AI API keys.
Request path
POST {BASE_URL}/api/v1/embeddings
Request header
Name |
Required |
Example value |
Description |
|---|---|---|---|
| Authorization | Yes | Bearer YOUR_API_KEY | Authentication information |
| Content-Type | No | application/json | Request body format |
Request parameters
Path
None
Query
None
Body
Name |
Type |
Required |
Example value |
Description |
|---|---|---|---|---|
| model | string | Yes | text-embedding-3-small | The name of the model to use for generating the embedding vector |
| input | unknown | Yes | "The quick brown fox jumps over the lazy dog" | The input content to generate a vector for, which can be a string, string array, or other format |
| encoding_format | string | No | float | The vector encoding format, such as "float" or "base64" |
| dimensions | integer | No | 512 | The dimension of the generated vector |
| parameters | object | No | {} | Additional model-specific parameters |
Response
Response parameters
Name |
Type |
Description |
|---|---|---|
| success | boolean | Whether the request was successful |
| code | string | Return code |
| message | string | Response message. |
| data | object | Response data. |
data
Name |
Type |
Description |
|---|---|---|
| id | string | Resource unique ID |
| name | string | Resource name |
| status | string | Resource status |
| createTime | string | Creation time |
Request example
curl --request POST '{BASE_URL}/api/v1/embeddings' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"model": "text-embedding-3-small",
"input": "The quick brown fox jumps over the lazy dog",
"encoding_format": "float",
"dimensions": 512
}'
Response example
{
"success": true,
"code": "200",
"message": "successful",
"data": {
"id": "emb_abc123",
"name": "embedding-result",
"status": "COMPLETED",
"createTime": "2026-04-10T10:00:00Z"
}
}
