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 a Gateway API key.

OpenAI fields

The gateway reads model, input (a string, a list of strings, or token ids), encoding_format, dimensions and user. Any other field is sent to the provider as is, including provider_options and self_heal, which are not read here. provider_api_key is refused.
Only embedding models of openai, azure, mistral and alibaba are served. Mistral answers float arrays only, whatever encoding_format says.

Weflayr fields

The gateway reads these fields on top of the OpenAI ones and never sends them to the provider. With the OpenAI SDK, pass them in extra_body (Python) or as extra keys of the request object (Node.js).
string
required
An embedding model name (e.g. text-embedding-3-small), as GET /v1/models lists them. Do not prefix the name with the provider: the provider goes in provider. Routing strategies are not served here.
string
Serve the model from this provider only: alibaba, azure, mistral or openai. Omit to let Weflayr pick one.
string
Serve the model from this region only: GLOBAL, US or EU. Omit to let Weflayr pick one, preferring GLOBAL, then US, then EU.
object
What the call is for, shown on your dashboards.
JSON object
The feature the call belongs to, as {"feature_name": "search"}. It also takes feature_run_uuid (32 hex characters, to group the calls of one feature run), customer_name, call_name and tags; the body’s weflayr values win over the header’s. The SDKs set this header for you.

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.