Skip to main content
POST
Generate Text Embeddings

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
input
required

Input text to embed, encoded as a string or a list of strings. To embed multiple inputs in a single request, pass a list of strings. The input must not exceed the max input tokens for the model, cannot be an empty string.

Example:

"The quick brown fox jumped over the lazy dog"

model
string
required

Use your aligned model id (e.g. aligned-model-01kmqm4nrn9fw6r). The same aligned id serves chat completions, completions, embeddings and reranking. Alignment shapes the model's representation space, so aligned embeddings are recommended for domain retrieval. Base embedding models (e.g. nugen-flash-embed) also work if you have not aligned a model yet.

Examples:

"aligned-model-01kmqm4nrn9fw6r"

"nugen-flash-embed"

dimensions
integer | null

(Applicable for only Resizable Matryoshka Embedding models) The number of dimensions the resulting output embeddings should have.

Response

Vector embeddings and usage statistics

id
string | null
required

A unique identifier of the response.

data
EmbeddingObject · object[] | null
required

The list of embeddings generated by the model.

model
string | null
required

The name of the model used to generate the embedding.

created
number | null
required

The Unix time in seconds when the response was generated.

usage
EmbeddingUsage · object | null
required

The usage information for the request.

object
string | null
default:embedding

The object type, which is always 'embedding'.

Allowed value: "embedding"