Skip to main content
models lists backup models in priority order. If the model in model cannot serve the request, the next one is tried.
The response model field names the model that answered, and you are billed at that model’s price.

When the next model runs

A request moves on only before any output has been sent. Each model’s providers are tried in provider order before the next model starts. provider.allow_fallbacks: false turns off retries after a failure, both to other providers and to the next model. Models without any usable provider are still skipped.

Format by endpoint

On Messages, fallbacks matches the shape used by Anthropic clients. Each entry accepts only model. Sending both fallbacks and models returns 400.

Rules

  • Up to 3 fallback models. More returns 400.
  • Entries that repeat the primary model, or each other, are skipped.
  • Entries that are not public models, or name an unknown provider pin, are skipped.
  • Routing variants and provider pins work per entry: "models": ["kimi-k2.6:nitro", "<provider-id>/glm-5.2"]. Effort suffixes on fallback entries are ignored; the request’s reasoning_effort applies to every model.
  • Your account and request provider settings apply to every model in the list.

With the OpenAI SDK

models is not an OpenAI parameter. Pass it through extra_body:

With the Auto Router

With model: "auto", the router builds its own fallback list of up to two models, and a models array you send is replaced. To limit which models Auto may use, set router.allowed_models instead.

Free models

Each model is billed at its own price. If a :free model falls back to a paid model, the request is billed at the paid price. To keep a request free, list only :free models.