Back to library
AI
tutorial

Implement Automatic Model Fallbacks to Maintain Workflow Continuity

Prevent automated workflow breaks by configuring model fallbacks for refusals.

Use the new 'fallbacks' API parameter to automatically reroute requests to a secondary model if Claude Fable 5 issues a 'refusal' stop reason.

Claude

The Scenario

You are building an automated agent that processes user-generated content and you want to ensure the workflow doesn't stop if a specific model's safety classifier triggers a refusal.

Before & after

The old way

When a model refused a request due to safety filters, you had to manually rewrite the prompt or switch models yourself, which could take 5-10 minutes per occurrence.

With AI

By enabling the 'fallbacks' parameter in your API calls, the system automatically redirects to an alternative model in seconds without manual intervention.

The Prompt

// API Configuration Example
{
  "model": "claude-fable-5",
  "max_tokens": 4096,
  "fallbacks": ["claude-sonnet-4.6"],
  "messages": [{"role": "user", "content": "[YOUR_COMPLEX_PROMPT]"}]
}

The new opt-in fallbacks parameter is ideal for agentic workflows where you don't want a refusal to break the entire chain of operations.

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