Skip to main content
POST
The body is an OpenAI Embeddings request: the gateway sends it to the provider with model replaced by the provider’s own model id, and answers with the provider’s response. Point any OpenAI client at https://gateway.weflayr.com/v1 with an API key with the Gateway scope.

Request body

string
required
An embedding model name (e.g. text-embedding-3-small), as GET /v1/models?output_modalities=embeddings lists them. Do not prefix it with the provider: set provider instead. A list of model names is tried in order (see fallback). A routing strategy is not accepted here: strategy/<slug> returns a 400 unknown_model.
string
required
The text to embed: a string, a list of strings, or token ids.
string
default:"float"
float or base64. Mistral answers floats whatever this says.
integer
The number of dimensions of each embedding, on the models that can shorten them.
string
An id of your end user, passed to the provider.
Only the embedding models of OpenAI, Azure, Mistral and Alibaba are served. Any other field is sent to the provider as is; self_heal and provider_options are not read here, and provider_api_key is refused.

Response

An OpenAI embedding list, with the fields the provider sent.

Errors

A model that is not an embedding model, or a provider that serves no embeddings, returns a 400 embeddings_unsupported. For the other errors, see Errors.