Skip to main content
POST
Create embeddings

Corps de la requête

string
requis
Modèle d’embedding à utiliser (par exemple, text-embedding-3-small, text-embedding-3-large).
string | string[]
requis
Le(s) texte(s) à transformer en embedding. Peut être une chaîne unique ou un tableau de chaînes.
string
défaut:"float"
Le format des embeddings. float ou base64.
integer
Le nombre de dimensions pour les embeddings de sortie (dépend du modèle).

Réponse

Exemple

Embeddings par lots

Vous pouvez transformer plusieurs textes en embeddings en une seule requête :

Autorisations

Authorization
string
header
requis

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

Corps

application/json

Request body for creating embeddings.

model
string
requis

ID of the model to use.

input
requis

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

encoding_format
enum<string>
défaut:float

The format to return the embeddings in.

Options disponibles:
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.

Réponse

Embedding response.

Response from an embedding request.

object
enum<string>

The object type, always 'list'.

Options disponibles:
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.