/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
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.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.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
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.