Skip to main content
POST
/
v1
/
embeddings
Error
A valid request URL is required to generate request examples
{}
POST /v1/embeddings 用于把文本转换为向量,适合语义检索、聚类、召回和重排前的候选生成。

请求示例

curl -X POST "https://models.kapon.cloud/v1/embeddings" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "text-embedding-3-small",
    "input": "kapon 支持统一调用多种模型能力"
  }'

常见用法

  • 将知识库文档切片后写入向量数据库。
  • 对用户查询生成向量,用于相似内容召回。
  • 与模型列表接口结合,按 Token 可用模型动态选择 embedding 模型。
如果你需要排查调用问题,请记录响应头中的请求 ID,并参考 请求追踪

Authorizations

Authorization
string
header
required

Authorization: Bearer

Body

application/json

The body is of type object.

Response

200 - application/json

OK

The response is of type object.