Skip to Content
goldflow.cc 文档
音频与其他其他能力

嵌入(Embeddings)

POST
/v1/embeddings

OpenAI Embeddings API 兼容接口,用于将文本转换为向量。支持 gemini-embedding-001、text-embedding-004、amazon.titan-embed-text-v2:0 等模型。

Authorization

bearerAuth
headerAuthorizationBearer <API key>

使用 Authorization Bearer API Key 进行鉴权。

Request Body

application/json
  1. body
model*string

要调用的模型 ID。

input*|array<string>

用于生成向量的输入文本,部分模型支持字符串数组。

dimensions?integer

输出向量维度,部分模型支持压缩到指定维度。

encoding_format?string

向量编码格式。

Value in"float""base64"

Response Body

向量嵌入响应。

application/json
  1. response
object?string

对象类型。

data?array<>

向量结果列表。

model?string

实际生成向量使用的模型 ID。

usage?
curl -X POST 'https://goldflow.cc/v1/embeddings' \  -H 'Content-Type: application/json' \  -d '{  "model": "gemini-embedding-001",  "input": "goldflow.cc 是一个企业级 AI API 网关"}'
Example Response
{  "object": "string",  "data": [    {      "object": "string",      "index": 0,      "embedding": [        0      ]    }  ],  "model": "string",  "usage": {    "prompt_tokens": 0,    "completion_tokens": 0,    "total_tokens": 0,    "input_tokens": 0,    "output_tokens": 0  }}