API Key 接口

POST /v1/embeddings

创建文本嵌入

将文本转换为向量嵌入

POST/v1/embeddings

身份验证

Authorizationstring必填

使用 OneAster 推理 API Key(Bearer sk-…)。

Authorization: Bearer $ONEASTER_API_KEY

请求正文 · application/json

modelstring必填
inputoneOf必填

要嵌入的文本

encoding_formatstring
dimensionsinteger

输出向量维度

JSON Schema
{
  "type": "object",
  "required": [
    "model",
    "input"
  ],
  "properties": {
    "model": {
      "type": "string",
      "example": "text-embedding-ada-002"
    },
    "input": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      ],
      "description": "要嵌入的文本"
    },
    "encoding_format": {
      "type": "string",
      "enum": [
        "float",
        "base64"
      ],
      "default": "float"
    },
    "dimensions": {
      "type": "integer",
      "description": "输出向量维度"
    }
  }
}