Skip to main content
POST
Create embeddings

Request Body

string
required
Embedding model to use (e.g., text-embedding-3-small, text-embedding-3-large).
string | string[]
required
The text(s) to embed. Can be a single string or an array of strings.
string
default:"float"
The format of the embeddings. float or base64.
integer
The number of dimensions for the output embeddings (model-dependent).

Response

Example

Batch Embeddings

You can embed multiple texts in a single request:

Authorizations

Authorization
string
header
required

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

Body

application/json

Request body for creating embeddings.

model
string
required

ID of the model to use.

input
required

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

encoding_format
enum<string>
default:float

The format to return the embeddings in.

Available options:
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.

Response

Embedding response.

Response from an embedding request.

object
enum<string>

The object type, always 'list'.

Available options:
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.