Skip to main content
The /v1/embeddings endpoint converts text into dense numerical vectors (embeddings) that capture semantic meaning. These vectors are useful for semantic search, retrieval-augmented generation (RAG), clustering, and similarity ranking. MonoRelay routes the request to the appropriate provider based on your model routing configuration and returns the embeddings in the standard OpenAI format.

Method and path

Authentication

Include your Bearer token in the Authorization header.

Request body

string
required
The embedding model to use, such as text-embedding-3-small or text-embedding-ada-002. Accepts aliases and model@provider syntax.
string | string[]
required
The text to embed. Pass a single string for one embedding, or an array of strings to embed multiple texts in a single request. All strings are processed as a batch by the upstream provider.
string
default:"float"
The format of the returned embeddings. Use "float" for a list of floating-point numbers, or "base64" for a base64-encoded binary representation. Not all providers support "base64".

Response

string
Always "list".
object[]
Array of embedding objects, one per input string, in the same order as the input.
string
The model name as returned by the upstream provider.
object
Token usage for the request.

Examples

Error responses

Errors are returned as JSON with HTTP 503. The message field is prefixed with the provider name for easier debugging.