400, 401, and invalid request errors before you call another model.
Implement ordered fallback
The following Python example tries model IDs in order and stops on non-retryable errors:Choose fallback models
The following request lists available model IDs that you can evaluate for fallback:Common errors
| Error | Fix |
|---|---|
| Fallback hides invalid requests | Do not fallback on 400, 401, or invalid request errors. |
| Models have different output formats | Normalize the response in your app before returning it to users. |
| Fallback increases cost | Estimate cost for each model before adding it to the fallback list. |
| Too many parallel fallbacks | Try fallbacks sequentially unless your product requires parallel racing. |