{
"object": "list",
"model": "YOUR_MODEL_ID",
"data": [
{
"object": "embedding",
"index": 0,
"embedding": [
0.6,
0.8
]
}
],
"usage": {
"prompt_tokens": 2,
"total_tokens": 2
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}API reference
Create embeddings
Request parameters, responses, and channel compatibility.
{
"object": "list",
"model": "YOUR_MODEL_ID",
"data": [
{
"object": "embedding",
"index": 0,
"embedding": [
0.6,
0.8
]
}
],
"usage": {
"prompt_tokens": 2,
"total_tokens": 2
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}POST /v1/embeddings
Send JSON with an explicit model and nonempty text input. Use a string array for a batch. This reference covers portable text inputs; upstream token-ID arrays are not guaranteed across channels.
Start with encoding_format: float. Confirm channel support for dimensions, Base64, and model-specific parameters. Match responses to inputs by data[].index and check counts, dimensions, and values before storing. This endpoint returns vectors, not a document index, and the request described here is not SSE.
Guide and runnable example
简体中文Authorizations
模型调用 API Key,不是控制台登录凭据 / Model API key, not console login credentials
Body
application/json
支持此接口且当前密钥可用的模型 / Model available to this key and supporting this endpoint
Example:
"YOUR_MODEL_ID"
可迁移基线:非空文本或非空文本数组;token ID 输入不保证跨渠道兼容 / Portable baseline: nonempty text or text array; token-ID inputs are not guaranteed across channels
Minimum string length:
1请求向量编码,需渠道支持;推荐显式 float / Requested vector encoding when supported; explicitly request float for the baseline
Available options:
float, base64 输出维度,仅部分模型/渠道支持,不能任意截断 / Output dimensions, only for supporting models/channels; do not truncate arbitrarily
Required range:
x >= 1可选应用用户标识;非认证凭据,转发取决于渠道 / Optional application user identifier, not authentication; forwarding depends on channel