Model fallbacks now available in Vercel AI Gateway
By Steven Van ·
Fallback models are tried in order until one succeeds, and billing is based on whichever model actually completes the request.
Vercel's AI Gateway can now fall back to another model when a request fails, instead of just returning an error. Fallback models are tried in the order given until one succeeds or the list runs out, and the request is billed based on whichever model actually completes it.
A fallback can be triggered by a provider outage, a context limit, an unsupported input, or a capability mismatch, such as a primary model that lacks multimodal support falling back to one that has it. Fallbacks are set with a models array inside providerOptions.gateway, and can be combined with provider routing (order or only) to also control which underlying provider handles each attempt.
Read the announcement for setup examples.
