Appearance
Embeddings
创建文本嵌入向量。
POST /v1/embeddingsBase URL: https://www.sky-ze.com
请求参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
model | string | ✓ | 模型 ID |
input | string/array | ✓ | 要嵌入的文本,支持字符串或字符串数组 |
encoding_format | string | float 或 base64,默认 float |
示例
curl
bash
curl https://www.sky-ze.com/v1/embeddings \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $OPT_API_KEY" \
-d '{
"model": "qwen3-max-2026-01-23",
"input": "人工智能是计算机科学的一个分支"
}'响应
json
{
"object": "list",
"data": [
{
"object": "embedding",
"index": 0,
"embedding": [0.0123, -0.0456, 0.0789, ...]
}
],
"model": "qwen3-max-2026-01-23",
"usage": {
"prompt_tokens": 6,
"total_tokens": 6
}
}