Skip to main content
Every model takes a different set of parameters. A temperature that GPT-5.4 takes without reasoning is refused once it reasons, Claude Opus 4.7 and later refuse a top_p, Anthropic has no seed, some models cannot turn thinking off. The same request that works on one model fails with a 400 on another. That matters most when calls are routed: a routing strategy or a fallback can send your request to a model your code was never written for. Self-heal adapts the request to that model, so the call is answered instead of failing. Whether self-heal is on or off, the gateway always writes your request in each provider’s own format (reasoning settings, cache breakpoints…). Self-heal goes one step further: it removes or adjusts the parameters a model does not take, which can slightly change how the model answers. It does this before the request is sent: the provider never sees the parameter it would refuse, so there is no failed call, no retry and no extra round trip to the provider.

What self-heal does

Thinking

Sampling and output parameters

Tools

Prompt caching

What self-heal does not do

Self-heal only makes small changes, the kind that keep your app working with at most a slight difference in the answer, such as dropping a seed or moving a thinking level one step. It never makes a change with a big effect, such as a different price per token or a question asked without its image:
  • Service tier: a service_tier no provider of the model offers is not removed by self-heal, since it changes the price of the call: it is removed only when your request lists it in drop_inputs_if_unsupported, and refused with a 400 otherwise.
  • Inputs the answer depends on: an image, a PDF, tools, a response schema or a web search sent to a model that does not take them is refused with a 400, since removing it would change the question asked.
  • Forced web search: a tool_choice forcing the web search, on a model that chooses by itself whether to call a tool, is refused with a 400 rather than replaced with auto, since the model could then answer without searching.

Configuration

Set it per call with the self_heal field.