Skip to content

批量输入(数组)

  • 接口POST https://api.olddog.shop/v1/embeddings

当你有多条文本需要一次性生成向量时,将 input 传为数组即可。

请求参数(差异点)

参数名类型是否必填说明
inputarray文本数组,例如 ["a", "b", "c"]

cURL 示例(批量)

bash
curl --request POST "https://api.olddog.shop/v1/embeddings" \
  --header "Authorization: Bearer $OLD_DOG_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "model": "text-embedding-3-small",
    "input": [
      "第一条文本",
      "第二条文本",
      "第三条文本"
    ]
  }'