Create Embeddings
Turn text into embedding vectors.
OpenAI-compatible: point the OpenAI SDK’s embeddings client at this gateway and it
works unchanged. input takes a single string or a batch, and the response keeps
the input order so you can zip results back to your records.
model is required and must name a specific embedding model — auto is rejected,
because a vector is only comparable to other vectors from the same model, so
silently choosing one for you would corrupt an index. Provider failover and BYOK
keys apply as they do to chat.
Authorizations
Headers
Dated version of the API contract to pin this request to. Omit it and the request is served under 2026-08 — the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with 400 invalid_api_version rather than falling back silently. The version actually served is echoed as X-Mesh-Version on every response, including errors.
2026-08, 2026-09, 2026-11, 2026-11-12 Body
Request body for POST /v1/embeddings.
Mirrors the OpenAI embeddings API. The input field accepts
four shapes:
- string — a single text to embed
- list[string] — a batch of texts
- list[int] — a single pre-tokenised input (token IDs)
- list[list[int]] — a batch of pre-tokenised inputs
Provider routing preference, accepted for compatibility and not forwarded to any upstream. A provider slug string (e.g. 'perplexity') or a ProviderPreferences object is validated and then dropped; it neither pins nor narrows which provider serves. Pin the API key to serve embeddings from exactly one provider.
A stable, anonymised identifier for the end user making this request, recorded on the usage row and available as a filter and a group-by dimension in the usage API. Supersedes the deprecated user field. Use an opaque id, not an email address or a name.
256Response
Embedding response