# Fallback Model

`ai-gateway-fallback-model-v2`

Fallback Model adds two kinds of backup to an app's model selection, per
capability:

- **`fallback`**—the model to try after a provider error that can be retried, or
  after a timeout.
- **`quotaFallback`**—the model to use when a usage limit is hit, instead of
  rejecting the request. [Budgets and Costs](./metering.mdx) is what applies
  this.

`fallbackTimeoutSeconds` controls how long the gateway waits before giving up on
the main model and trying the fallback. It defaults to 60 seconds and accepts 1
to 300. A fallback that names the same model as the main one is skipped.

:::warning

This policy only enriches a model selection that already exists—it never creates
one. An app whose chain has Fallback Model but no
[Model Filtering](./model-filtering.mdx) does nothing at all: the policy logs a
warning and passes the request through unchanged. Place Fallback Model
immediately after Model Filtering.

:::

That ordering is also why a fallback can never widen what an app may reach—the
filter has already accepted or rejected the request by the time this policy
runs.

For the portal workflow and worked examples see
[Fallback Models](../fallback.mdx); for every option see the
[generated reference](/policies/ai-gateway-fallback-model-v2-inbound).
