Skip to main content
POST
The body is an OpenAI Responses 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, input, instructions, tools, tool_choice, text, reasoning, max_output_tokens, temperature, top_p, parallel_tool_calls, service_tier, user, metadata, stream, stream_options, top_logprobs, include, store, prompt_cache_key, prompt_cache_retention, safety_identifier, max_tool_calls, truncation, previous_response_id, conversation, background and prompt.
previous_response_id, conversation, store: true, prompt, metadata, text.verbosity and most include entries work with OpenAI models only. background: true, n, and built-in tools other than web_search are refused for every model.

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 Response 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 Responses events, from response.created to response.completed. Warnings then come first, in a weflayr.warnings event.

Errors

See Errors.