Skip to main content
POST
The body is an OpenAI Chat Completions request, whatever the provider: the gateway translates it for Anthropic, Google, Bedrock, Mistral and the others, and answers in OpenAI’s format. Point any OpenAI client at https://gateway.weflayr.com/v1 with a Gateway API key.

OpenAI fields

The gateway reads model, messages, max_completion_tokens (or the deprecated max_tokens), temperature, top_p, top_k, stop, stream, stream_options, tools (function tools), tool_choice, parallel_tool_calls, response_format, reasoning_effort, service_tier (flex or priority keep only the providers that offer it), presence_penalty, frequency_penalty, seed, n, logprobs, top_logprobs, user and web_search_options.
OpenAI, Azure and xAI models are called through their Responses API, which has no stop, seed, presence_penalty, frequency_penalty, top_k, logit_bias, audio, modalities, metadata, store, or n above 1: sending one of these to those models returns a 400.

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
A model name, as listed in the model picker of a benchmark (e.g. claude-opus-5-5, gpt-5.6), or a routing strategy id: strategy/<id> for its latest version, strategy/<id>:<version> to pin one.
string
Serve the model from this provider only: alibaba, anthropic, azure, bedrock, google, mistral, openai, spacexai or vertex. Omit to let Weflayr pick one. Not allowed with a routing strategy.
string
Serve the model from this region only: GLOBAL, US, EU, or a provider’s own region (e.g. eu-west-1 on Bedrock). Not allowed with a routing strategy.
"on_with_warnings" | "on" | "off"
default:"\"on_with_warnings\""
What to do with a parameter the model does not take (e.g. temperature on a reasoning model): on_with_warnings removes it and lists the change in weflayr_warnings, on removes it silently, off sends the request unchanged.
list[string]
Parameters to remove when the model does not take them, even with self_heal: "off": any of service_tier, temperature, tool_choice, reasoning, cache_breakpoints, parallel_tool_calls.
object
Raw provider fields merged into the request sent to the provider, keyed by common (every provider), an API family (e.g. anthropic_messages, gemini_generate_content) or a provider (e.g. openai).
object
What the call is for, shown on your dashboards.
JSON object
The feature the call belongs to, as {"feature_name": "support-chat"}. 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 Chat Completion object. When self_heal changed the request, the response also carries weflayr_warnings, a list of the changes. With "stream": true, the gateway answers with OpenAI’s server-sent events, ending with data: [DONE]. Warnings then come first, in a chunk with no choice.

Errors

See Errors.