向量生成 /v1/embeddings
POST
/v1/embeddings请求参数
Body 参数application/json
No schema defined
示例
{
"model": "text-embedding-ada-002",
"input": "The food was delicious and the waiter..."
}
示例代码
返回响应
成功(200)
HTTP 状态码: 200
内容格式: JSONapplication/json
数据结构
object
string
必需
data
array [object {3}]
必需
object
string
可选
embedding
array[number]
向量数据值
index
integer
可选
model
string
必需
usage
object
消耗
prompt_tokens
integer
输入 tokens
total_tokens
integer
总 tokens
示例
{
"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
}
}
最后修改时间: 1 年前