API 参考
Embeddings
把文本转换为向量
POST https://netnexus.top/api/v1/embeddings请求参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
model | string | 是 | 向量模型 ID,如 text-embedding-3-small |
input | string / array | 是 | 要向量化的文本,可传数组批量处理 |
dimensions | integer | 否 | 输出向量维度(部分模型支持) |
encoding_format | string | 否 | float(默认)或 base64 |
请求示例
curl https://netnexus.top/api/v1/embeddings \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "text-embedding-3-small",
"input": ["智枢网关让企业轻松接入大模型", "对公结算,正规发票"]
}'返回示例
{
"object": "list",
"model": "text-embedding-3-small",
"data": [{ "object": "embedding", "index": 0, "embedding": [0.0123, -0.0456, 0.0789] }],
"usage": { "prompt_tokens": 12, "total_tokens": 12 }
}