Eliminate Service Gaps with Claude’s New Automated Model Fallbacks
Configure automated model switching for refused requests.
Use the 'fallbacks' parameter in the Claude API to automatically re-route requests that trigger safety refusals to a secondary model.
The Scenario
You are building an AI-powered application and want to ensure that if a complex prompt is flagged or refused by the primary model, the system automatically tries a backup model to maintain user experience.
Before & after
Developers had to manually catch 'refusal' errors in their code and write custom logic to retry the prompt with a different model. This manual error-handling setup could take 30–60 minutes to code and test.
With the new 'fallbacks' parameter, setting up an automated safety bridge takes about 5 minutes of configuration. If a request is refused, it automatically re-routes to a secondary model without manual intervention.
The Prompt
// Example API configuration for developers
{
"model": "claude-fable-5",
"max_tokens": 1024,
"fallbacks": [{"model": "claude-3-5-sonnet-20240620"}],
"messages": [{"role": "user", "content": "[PASTE_PROMPT_HERE]"}]
}When safety classifiers decline a request, you get a 'refusal' stop_reason. The beta 'fallbacks' parameter allows for seamless continuity by running the request on a different model.
Source
Claude Platform - Claude API Docs"An opt-in fallbacks parameter... re-runs refused requests on another model, billed at the fallback model's rates."
