Skip to main content
The /v1/embeddings endpoint converts one or more text strings into high-dimensional numeric vectors. These embeddings capture semantic meaning, so texts with similar meaning produce vectors that are close together in the vector space. Use embeddings to power semantic search, document clustering, recommendation systems, and retrieval-augmented generation (RAG) pipelines.

Endpoint

Request Parameters

string
required
The ID of the embedding model to use. Embedding models are separate from chat and completion models — call GET /v1/models and filter for models with object: "embedding" to see your options.
string | array
required
The text(s) to embed. Pass a single string to embed one piece of text, or an array of strings to embed multiple texts in a single request. Each string is embedded independently; the order of the output data array matches the order of your input.
string
The format of the returned embedding vectors. Use "float" (default) to receive a standard JSON array of floating-point numbers, or "base64" to receive a base64-encoded binary blob, which reduces response payload size for large batches.

Request Examples

Response Fields

string
Always "list".
string
The embedding model ID that was used to generate the vectors.
array
An array of embedding objects, one per input string, in the same order as your input array.
object
Token usage statistics for the request.

Example Response

The number of dimensions in the returned vector depends on the embedding model you choose. Check the model details via GET /v1/models/{model_id} for the dimensions field before designing your vector store schema — storing vectors with the wrong dimension will cause index errors. Changing models after populating a vector store requires re-embedding all existing records.