Skip to main content
POST
Create embeddings

Thân Yêu Cầu

string
bắt buộc
Mô hình embedding để sử dụng (ví dụ: text-embedding-3-small, text-embedding-3-large).
string | string[]
bắt buộc
(Các) văn bản để embed. Có thể là một chuỗi đơn lẻ hoặc một mảng chuỗi.
string
mặc định:"float"
Định dạng của embedding. float hoặc base64.
integer
Số chiều cho embedding đầu ra (phụ thuộc vào mô hình).

Phản Hồi

Ví Dụ

Embedding Hàng Loạt

Bạn có thể embed nhiều văn bản trong một yêu cầu duy nhất:

Ủy quyền

Authorization
string
header
bắt buộc

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

Nội dung

application/json

Request body for creating embeddings.

model
string
bắt buộc

ID of the model to use.

input
bắt buộc

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

encoding_format
enum<string>
mặc định:float

The format to return the embeddings in.

Tùy chọn có sẵn:
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.

Phản hồi

Embedding response.

Response from an embedding request.

object
enum<string>

The object type, always 'list'.

Tùy chọn có sẵn:
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.