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.