POST
/v1/embeddings创建嵌入
API Key application/json
请求示例
curl -X POST https://top.qingyuntop.ai/v1/embeddings \
-H "Authorization: Bearer ${QINGYUN_TOP_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"model": "text-embedding-3-large",
"input": "喵喵喵喵喵喵喵喵喵喵喵喵喵喵喵"
}'请求参数
| 参数 | 位置 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|---|
Authorization | Header | string | 否 | - | Bearer {{YOUR_API_KEY}} |
model | JSON body | string | 是 | 要使用的模型的 ID。您可以使用[List models](https://platform.openai.com/docs/api-reference/models/list) API 来查看所有可用模型,或查看我们的[模型概述](https://platform.openai.com/docs/models/overview)以了解它们的描述。 | - |
input | JSON body | string | 是 | 输入文本以获取嵌入,编码为字符串或标记数组。要在单个请求中获取多个输入的嵌入,请传递一个字符串数组或令牌数组数组。每个输入的长度不得超过 8192 个标记。 | - |
返回响应 (200)
| 参数 | 位置 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|---|
object | 响应 JSON | string | 是 | - | - |
data | 响应 JSON | array<object> | 是 | - | - |
data[].object | 响应 JSON | string | 否 | - | - |
data[].embedding | 响应 JSON | array<number> | 否 | - | - |
data[].index | 响应 JSON | integer | 否 | - | - |
model | 响应 JSON | string | 是 | - | - |
usage | 响应 JSON | object | 是 | - | - |
usage.prompt_tokens | 响应 JSON | integer | 是 | - | - |
usage.total_tokens | 响应 JSON | integer | 是 | - | - |
响应示例
{
"object": "list",
"data": [
{
"object": "embedding",
"embedding": [
0.0023064255,
-0.009327292,
.... (1536 floats total for ada-002)
-0.0028842222
],
"index": 0
}
],
"model": "text-embedding-ada-002",
"usage": {
"prompt_tokens": 8,
"total_tokens": 8
}
}来源原始接口定义(用于追溯)
以下内容来自 Apifox 快照,可能包含兼容层字段或旧示例;公开调用请以本页的协议说明和当前模型列表为准。
{
"id": 497673476,
"name": "创建嵌入",
"type": "http",
"serverId": "",
"preProcessors": [],
"postProcessors": [],
"inheritPreProcessors": {},
"inheritPostProcessors": {},
"description": "获取给定输入的矢量表示,机器学习模型和算法可以轻松使用该表示。\n\n相关指南:[嵌入](https://platform.openai.com/docs/guides/embeddings)\n\n创建表示输入文本的嵌入向量。\n\n",
"operationId": "",
"sourceUrl": "",
"method": "post",
"path": "/v1/embeddings",
"tags": [],
"status": 1,
"requestBody": {
"type": "application/json",
"parameters": [],
"jsonSchema": {
"type": "object",
"properties": {
"model": {
"type": "string",
"description": "要使用的模型的 ID。您可以使用[List models](https://platform.openai.com/docs/api-reference/models/list) API 来查看所有可用模型,或查看我们的[模型概述](https://platform.openai.com/docs/models/overview)以了解它们的描述。"
},
"input": {
"type": "string",
"description": "输入文本以获取嵌入,编码为字符串或标记数组。要在单个请求中获取多个输入的嵌入,请传递一个字符串数组或令牌数组数组。每个输入的长度不得超过 8192 个标记。"
}
},
"required": [
"model",
"input"
],
"x-apifox-orders": [
"model",
"input"
]
},
"examples": [
{
"value": "{\n \"model\": \"text-embedding-3-large\",\n \"input\": \"喵喵喵喵喵喵喵喵喵喵喵喵喵喵喵\"\n}",
"mediaType": "application/json",
"description": ""
}
],
"mediaType": "",
"oasExtensions": "",
"required": false,
"additionalContentTypes": []
},
"parameters": {
"path": [],
"query": [],
"cookie": [],
"header": [
{
"id": "tiNTkyHARU",
"name": "Authorization",
"required": false,
"enable": true,
"description": "",
"type": "string",
"sampleValue": "Bearer {{YOUR_API_KEY}}"
}
]
},
"commonParameters": {
"query": [],
"body": [],
"cookie": [],
"header": []
},
"auth": {},
"responses": [
{
"id": 109406256,
"name": "Create embeddings",
"code": 200,
"contentType": "json",
"jsonSchema": {
"type": "object",
"properties": {
"object": {
"type": "string"
},
"data": {
"type": "array",
"items": {
"type": "object",
"properties": {
"object": {
"type": "string"
},
"embedding": {
"type": "array",
"items": {
"type": "number"
}
},
"index": {
"type": "integer"
}
},
"x-apifox-orders": [
"object",
"embedding",
"index"
]
}
},
"model": {
"type": "string"
},
"usage": {
"type": "object",
"properties": {
"prompt_tokens": {
"type": "integer"
},
"total_tokens": {
"type": "integer"
}
},
"required": [
"prompt_tokens",
"total_tokens"
],
"x-apifox-orders": [
"prompt_tokens",
"total_tokens"
]
}
},
"required": [
"object",
"data",
"model",
"usage"
],
"x-apifox-orders": [
"object",
"data",
"model",
"usage"
]
},
"itemSchema": {},
"description": "",
"mediaType": "",
"headers": [],
"oasExtensions": ""
}
],
"responseExamples": [
{
"name": "Create embeddings",
"responseId": 109406256,
"data": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"object\": \"embedding\",\n \"embedding\": [\n 0.0023064255,\n -0.009327292,\n .... (1536 floats total for ada-002)\n -0.0028842222\n ],\n \"index\": 0\n }\n ],\n \"model\": \"text-embedding-ada-002\",\n \"usage\": {\n \"prompt_tokens\": 8,\n \"total_tokens\": 8\n }\n}",
"description": "",
"oasKey": "",
"oasExtensions": "",
"id": "019fd273-0857-73ed-869b-7720651c374c"
}
],
"codeSamples": [],
"projectId": 8662722,
"moduleId": 8310462,
"folderId": 92749356,
"ordering": 0,
"responsibleId": 0,
"commonResponseStatus": {},
"advancedSettings": {
"disabledSystemHeaders": {}
},
"customApiFields": {},
"oasExtensions": "",
"mockScript": {},
"createdAt": "2026-08-05T14:40:23.000Z",
"updatedAt": "2026-08-06T12:15:55.000Z",
"creatorId": 2863449,
"editorId": 2863449,
"creatorUserId": 2863449,
"editorUserId": 2863449,
"responseChildren": [],
"visibility": "INHERITED",
"securityScheme": {},
"callbacks": ""
}