Skip to main content
POST
Create embeddings

请求体

string
必填
要使用的嵌入模型(例如 text-embedding-3-small、text-embedding-3-large)。
string | string[]
必填
要嵌入的文本。可以是单个字符串或字符串数组。
string
默认值:"float"
嵌入的格式。float 或 base64。
integer
输出嵌入的维度数(取决于模型)。

响应

示例

批量嵌入

您可以在单个请求中嵌入多个文本:

授权

Authorization
string
header
必填

API key authentication. Pass your OpenModex API key as a Bearer token in the Authorization header: Authorization: Bearer omx_sk_...

请求体

application/json

Request body for creating embeddings.

model
string
必填

ID of the model to use.

input
必填

Input text to embed. Can be a single string or an array of strings.

encoding_format
enum<string>
默认值:float

The format to return the embeddings in.

可用选项:
float,
base64
dimensions
integer

The number of dimensions the resulting output embeddings should have. Only supported by certain models.

user
string

A unique identifier representing your end-user.

响应

Embedding response.

Response from an embedding request.

object
enum<string>

The object type, always 'list'.

可用选项:
list
data
object[]

A list of embedding objects.

model
string

The model used to generate the embeddings.

usage
object

Usage statistics for the embedding request.