POST
/
paas
/
v4
/
embeddings
文本嵌入
curl --request POST \
  --url https://open.bigmodel.cn/api/paas/v4/embeddings \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "embedding-3",
  "input": "<string>"
}'
{
  "model": "<string>",
  "object": "list",
  "data": [
    {
      "index": 123,
      "object": "embedding",
      "embedding": [
        123
      ]
    }
  ],
  "usage": {
    "prompt_tokens": 123,
    "completion_tokens": 123,
    "total_tokens": 123
  }
}

Authorizations

Authorization
string
header
required

使用以下格式进行身份验证:Bearer <your api key>

Body

application/json

Response

200
application/json

业务处理成功

文本嵌入响应对象,包含嵌入向量结果、模型信息和 tokens 统计。