Skip to main content
POST
文本/图片嵌入向量生成接口
Note: For setting the embedding model name, refer to the System Supported Embedding Models List. The request/response parameter structure is fully compatible with OpenAI. When switching models, you only need to modify the corresponding model name. If the model request/response parameters are inconsistent with OpenAI, GeekAI will automatically convert and align them at the underlying level. The response data format is fully compatible with OpenAI.

cURL Request Example

Authorizations

Authorization
string
header
required

API认证token

Body

application/json
model
string
required

嵌入模型

Example:

"text-embedding-3-small"

input
required

文本字符串或者图文对象列表,单行文本字符数受模型上下文长度限制

Example:
intent
enum<string>

嵌入意图,用于指定嵌入的使用场景,目前仅 Cohere 向量模型支持该字段,当对图片进行向量化需要指定为 image

Available options:
search_document,
search_query,
classification,
clustering,
image
dimensions
integer
default:1536

输出向量维度

Example:

1536

retries
integer
default:0

自动重试次数,默认0,表示失败不重试

Example:

0

Response

成功响应

model
string
required

使用的嵌入模型

Example:

"text-embedding-3-small"

data
object[]
required

嵌入向量数据列表

usage
object
required
object
enum<string>
default:list

响应对象类型

Available options:
list