批量输入(数组)
- 接口:
POST https://api.olddog.shop/v1/embeddings
当你有多条文本需要一次性生成向量时,将 input 传为数组即可。
请求参数(差异点)
| 参数名 | 类型 | 是否必填 | 说明 |
|---|---|---|---|
| input | array | 是 | 文本数组,例如 ["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": [
"第一条文本",
"第二条文本",
"第三条文本"
]
}'