Skip to main content
POST
/
v1
/
embeddings
cURL
curl --request POST \
  --url https://proxy.innk.cc/v1/embeddings \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "<string>",
  "input": "The food was delicious and the waiter...",
  "encoding_format": "float",
  "dimensions": 123
}
'
{
  "object": "<string>",
  "data": [
    {
      "object": "<string>",
      "embedding": [
        123
      ],
      "index": 123
    }
  ],
  "model": "<string>",
  "usage": {
    "prompt_tokens": 123,
    "total_tokens": 123
  }
}

Authorizations

Authorization
string
header
required

身份验证标头格式为 Bearer <API_KEY>,其中 <API_KEY> 是您的API令牌。

Body

application/json
model
string
required

要使用的模型的 ID

input
required

要嵌入的文本输入,可以编码为字符串或词元数组。要在单个请求中嵌入多个输入,请传递字符串数组或词元数组的数组。输入不能超过模型的最大输入词元数(所有嵌入模型均为 8192 个词元),不能为空字符串,且任何数组的维度必须小于等于 2048。示例 Python 代码用于统计词元数。除了每个输入的词元数限制外,所有嵌入模型还强制规定单个请求中所有输入的词元总数不得超过 300,000 个。

Example:

"The food was delicious and the waiter..."

encoding_format
enum<string>

返回嵌入的格式

Available options:
float,
base64
dimensions
integer

输出嵌入的维度数

Response

200 - application/json

Embedding vector

object
string
required

对象类型始终为“list”。

data
object[]
required

模型生成的嵌入列表

model
string
required

用于生成嵌入的模型名称。

usage
object
required

用量