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 an API key with the Gateway scope.

Request body

string
required
A model name (e.g. claude-opus-5-5, gpt-6-luna), as GET /v1/models lists them, or a routing strategy slug: strategy/<slug> for its latest version (strategy/<slug>:latest is the same), strategy/<slug>:<version> to pin one. Any other text after the : returns a 400 invalid_routing_strategy_version. Do not prefix the name with the provider (openai/gpt-6-luna is not found): set provider instead. A list of model names is tried in order (see fallback); a routing strategy cannot be in a list.
string
required
The prompt: a text, or a list of input items as the OpenAI Responses API writes them. A content part can mark a cache breakpoint with Anthropic’s cache_control or OpenAI’s prompt_cache_breakpoint, whatever the model: the gateway writes it the way the provider reads it.
string
The system prompt, placed before input.
object[]
The tools the model may call: function tools (type: "function", name, description, parameters, strict) and the built-in web_search tool.
string
auto, required or none, a function to call ({"type": "function", "name": "..."}), or {"type": "web_search"} to make the model search the web.
object
The answer’s format.
object
How much the model thinks before it answers. Through a routing strategy, its effort wins over the effort the strategy sets.
integer
The most tokens the answer can have, reasoning tokens included.
number
The sampling temperature.
number
Nucleus sampling: the model samples among the tokens making up this share of the probability.
boolean
Whether the model may call several tools in one turn.
string
auto, default, flex or priority. flex and priority keep only the providers that offer that tier.
string
An id of your end user, passed to the provider.
object
Up to 16 key-value pairs stored with the response by the provider.
boolean
default:"false"
true streams the answer as server-sent events (see Response).
object
include_obfuscation: false leaves out the padding OpenAI adds to each streamed event.
integer
The number of most likely tokens to return at each position, with their log probabilities. Needs message.output_text.logprobs in include.
string[]
Extra data to return in the response, such as message.output_text.logprobs or reasoning.encrypted_content.
boolean
Whether the provider stores the response, so a later request can name it in previous_response_id.
string
The id of a stored response to continue from, in place of sending the earlier turns in input.
string
The provider’s conversation this response belongs to: its id, or {"id": "..."}.
object
A prompt template stored at the provider, with its id, version and variables.
string
A key grouping requests that share a prompt prefix, to improve prompt cache hits. Used by OpenAI, Azure, xAI, Mistral and the Bedrock models called through their Responses API (e.g. some of OpenAI’s or Kimi K3). Claude, Gemini and the other Bedrock models refuse it. Without one, the gateway sends these providers a key of its own per organization and model.
string
in_memory or 24h: how long OpenAI keeps the cached prompt prefix. Sent to OpenAI, Azure and Bedrock’s Responses API models; with self-heal on, removed for Claude, Gemini, the other Bedrock models and xAI, which have no such field. To set a lifetime on any model taking cache breakpoints, use the breakpoint’s ttl: self-heal moves it to the closest lifetime the provider offers.
object
{"mode": "explicit"} turns off GPT-5.6+‘s implicit cache, so only your breakpoints are cached. Sent and removed like prompt_cache_retention.
string
A stable id of your end user, hashed, which the provider uses to detect abuse.
integer
The most built-in tool calls the model can make in one response.
string
auto drops the earliest input items when the prompt is longer than the model’s context, disabled (the default) refuses it.
boolean
Only false is accepted: the gateway does not run responses in the background.

Cache breakpoints

Mark cache breakpoints with OpenAI’s prompt_cache_breakpoint (with an optional ttl): it works on every provider, for every model that takes cache breakpoints, such as Claude, GPT-5.6 and later, Kimi, Qwen, GLM and Nova. Anthropic’s cache_control is accepted too. With self-heal on, the gateway removes the breakpoints on a model where they write no cache, and replaces a ttl the provider does not offer with the closest one it does: 5m or 1h on Claude, 30m or 12h on OpenAI and Azure.

Response

An OpenAI Response object. When the gateway changed the request or a routing strategy setting, or moved the request to another deployment, the response also has weflayr_warnings, the list of 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.