Back to library
AI
best practice

Enable Automated Fallbacks for Model Refusals

Automate model switching to maintain uptime during safety refusals.

Use the new 'fallbacks' API parameter to automatically re-run requests on alternative models whenever the primary model issues a refusal.

Claude

The Scenario

Your AI-powered application is processing diverse user inputs, and you want to ensure it doesn't crash or stop responding if Fable 5's safety filters block a specific request.

Before & after

The old way

When a model refuses a request due to safety filters, developers manually check error logs and re-send the prompt to a different model, taking 5–10 minutes per instance.

With AI

Implement the 'fallbacks' parameter in your API call to automatically re-route requests to a secondary model if a refusal occurs. Configuration takes about 5 minutes.

The Prompt

Review my API request structure and show me how to add the 'fallbacks' parameter to handle 'stop_reason: refusal' for Claude Fable 5: [PASTE_API_REQUEST_JSON]

Claude Fable 5 introduces a 'fallbacks' beta parameter. If the primary model returns a 'stop_reason: refusal', the system automatically switches to your designated fallback model. This ensures your application remains functional even if the most advanced model triggers a safety classifier.

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."