Claude refusals and fallback: How to handle an HTTP 200 decline

Read Claude’s refusal JSON, choose a fallback, and track which model answered and what you owe, even when the stream changes models mid-response.

Published

Claude refusals and fallback: How to handle an HTTP 200 decline

An HTTP 200 from Claude can mean the user got no answer. As of November 2026, Anthropic reports a classifier decline in the message itself, with stop_reason: "refusal". An app that checks only the HTTP status can show a blank answer, mark the job complete and keep a perfectly green error dashboard.

Where a refusal shows up

Read stop_reason before consuming the answer. On a refusal, stop_details.type is "refusal" and stop_details.category identifies the policy area when one is available. Show the user stop_details.explanation if present. Its wording can change. Both the category and explanation can legitimately be null, so have a plain message ready for that case. For every other stop reason, stop_details itself is null. Empty content alone is ambiguous, since even end_turn can have an empty response. Anthropic’s stop reasons reference

A request and its two possible outcomes

These are excerpts from Anthropic’s published samples. “Hello, Claude” is the placeholder in the request example. The refusal and fallback are separate response examples, not a claim that sending that greeting triggers either outcome. The scene follows the fields a handler reads. Anthropic’s request and response examples

Reading the request, a refusal and a fallback-served answer

model="claude-fable-5", messages=[{"role": "user", "content": "Hello, Claude"}]

{"content": [], "stop_reason": "refusal", "stop_details": {"type": "refusal", "category": "cyber", "explanation": "This request was declined because it could enable cyber harm."}}

{"type": "fallback", "from": {"model": "claude-fable-5"}, "to": {"model": "claude-opus-4-8"}, "trigger": {"type": "refusal", "category": "cyber"}}

{"model": "claude-opus-4-8", "stop_reason": "end_turn", "stop_details": null}

fallback_ran = any(i.type == "fallback_message" for i in response.usage.iterations or [])

served_by_fallback = fallback_ran and response.stop_reason != "refusal"

The top-level model names whoever produced the returned message. Each fallback block marks a change of model inside content. The original refusal category lives on that boundary under trigger.category, even when the final message has stop_details: null. This is where a chat UI can tell the user that another model took over.

Read usage.iterations when accounting for the work. In the fallback sample, the first message entry records 535 input tokens and zero output tokens for Fable. The fallback_message entry records 412 input tokens and 264 output tokens for Opus. Top-level usage reports 412 and 264, the counts for the returned message alone. If the whole chain declines, the last attempt still has type fallback_message, but the returned message is a refusal. A dashboard that counts every such entry as a recovered request overstates recovery.

Which refusals are billed?

Before any output, content is empty and usage reports tokens whether or not a charge applies. The rule is the same across platforms. Anthropic’s category and billing rules

stop_details.categoryWhat triggered the classifierBilled before any output?
cyberPotential cyber harm, including malware or exploit development. Benign security work can trigger it.No
bioPotential biological harm, including dangerous lab methods. Beneficial life-sciences work can trigger it.Yes
frontier_llmWork that could help develop competing AI models. Benign ML work can trigger it.Yes
reasoning_extractionA request to reproduce the model’s internal reasoning in its response text.Yes
general_harmsAnother usage-policy area. Benign work can trigger it.No
nullThe decline has no named category.No

Anthropic says it charges for pre-output refusals in the three billed categories to disrupt attempts to circumvent safeguards at scale. Those are the categories where it measured a low volume of false positives as of September 2026. It says the list can change. Every attempt that runs counts against that model’s rate limits, including an unbilled refusal.

Once output has started, the declined attempt incurs its normal input charge and the charge for output already streamed. A fallback attempt is accounted for separately at its own model’s rates. This matters even for a non-streaming app whose user never sees those discarded tokens.

If you train models

Anthropic defines frontier_llm this way: “The request could help with the development of competing AI models,” an activity it says its commercial terms restrict. Its next sentence matters just as much: “Benign machine learning work can also trigger this category.” If a training assistant stops, preserve the category with the job outcome and show the explanation. That record tells you a classifier intervened. It cannot establish why a different session produced poor code. Anthropic’s category definitions · Evidence behind the Claude sabotage claims

Who should handle the retry?

Where the request runsChooseWhat your app owns
Claude API or Claude Models on Google Cloud (Anthropic managed), on a supported modelServer-side fallback. Send fallbacks: "default" with anthropic-beta: server-side-fallback-2026-07-01.One call returns one message. Anthropic selects its recommended model for that refusal category. With no recommendation, the refusal stands.
An Anthropic SDK on any platformConfigure BetaRefusalFallbackMiddleware on the client. Calls through client.beta.messages use its fallback list.Share a BetaFallbackState across requests in the same conversation. The middleware retries and applies available credit. An exhausted list returns the last refusal.
Raw HTTP or an application with its own retry logicMake a manual retry on a permitted fallback model and redeem fallback credit where available.Detect the refusal, preserve the request fields needed for credit and keep subsequent turns on the model that accepted.

For the server-side beta, the SDK spelling in Anthropic’s Python example is:

Python
client = Anthropic()

response = client.beta.messages.create(
    model="claude-fable-5",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello, Claude"}],
    fallbacks="default",
    betas=["server-side-fallback-2026-07-01"],
)
print(response.model)

Default routing follows Anthropic’s recommendations as they change. An app that must use qualified models can instead name up to three distinct permitted targets. The beta Models API exposes allowed_fallback_models. A primary rate limit, overload or server error goes to your normal error handler. Only a safety classifier decline triggers this handoff. If a fallback is rate limited or overloaded, the API returns the preceding refusal and skips later entries. On requests that set fallbacks, stop_details.recommended_model can name a model when the fallback attempt was skipped. Otherwise the field is null. Anthropic’s server-side routing guide

For reasoning_extraction, Anthropic gives no recommended fallback. If the product needs a justification, ask for supporting evidence or a short explanation of the answer. Claude Haiku 5.5 has neither server-side fallback nor fallback credit. Use SDK middleware or a manual retry for eligible work and budget for the full cache write. SDK middleware · Anthropic’s refusal guide

What fallback credit actually pays for

Prompt caches belong to individual models. A long conversation may be cheap to read on the first model and expensive to write afresh on the second. Credit reprices the eligible cache work. It leaves the ordinary cost of answering on the fallback model in place. Server-side fallback and SDK middleware apply available credit automatically.

For a manual retry, send anthropic-beta: fallback-credit-2026-07-01 on the original request and the retry. Take fallback_credit_token from stop_details and send it at the top level on the retry. Preserve prompt-shaping fields, including earlier thinking blocks. When fallback_has_prefill_claim is true, append the assistant content using Anthropic’s echo rules so the model can continue. When false, use the retry body without that appended message. The token expires five minutes after the refusal. Look for cache-write tokens shifting to cache-read tokens in the retry’s usage. A warm cache can mean there is nothing to reprice. Fallback credit and exact request-matching rules

What a streaming user sees

If the final outcome is a refusal, discard any partial output as incomplete. When server-side fallback succeeds, the handoff has different semantics. The timing matters most in a chat UI that shows tokens as they arrive. Anthropic’s streaming and non-streaming behavior

When the primary declinesStreamingNon-streaming
Before outputmessage_start names the fallback model. The first content block marks the handoff. Time to first byte includes the declined attempt.The first content block is fallback. The returned message names the serving model.
After output beginsThe open block closes. A fallback block starts and stops without deltas. The next model continues on the same stream with the partial text as context.The API omits the partial output. The next model answers without that context, and the first block is fallback. The earlier output tokens remain in usage.iterations.

After a mid-stream handoff, message_start still names the primary. Update the displayed model from to.model on the boundary. The final message_delta includes the fallback_message usage entry.

For the next turn after a server-side handoff, preserve the boundary block in position. Keep text and everything after the final boundary. Before that boundary, drop thinking, redacted_thinking, connector_text and client-side tool_use. Keep an earlier server_tool_use only with its matching result. Moving the boundary can invalidate the thinking history. The SDK fallback middleware manages its own boundary blocks on later requests. Continuing the conversation

Why the next turn can have no handoff block

A follow-up can start on the model that answeredServer-side sticky routing across a conversation
After a successful fallback
Record the routeThe API retains a hash of the conversation prefix and the serving model.
Send the follow-upThe next request in the conversation includes fallbacks.
Start on the fallbackNo fresh decline means no boundary block on this turn.

As of Nov 29, 2026 · Source: Anthropic, Refusals and fallback

The route is scoped to the organization and retained for about an hour. The routing record contains no message content. It works for both request modes and is best effort, so the primary can be tried again at any time. Identify a sticky turn by the returned model, a fallback_message iteration and no message iteration for the requested model. A streaming client already sees the serving model in message_start. This is also why a fallback-served turn does not necessarily represent a new refusal. Anthropic’s sticky routing rules

When a batch succeeds with a refusal

A batch worker that accepts every result.type: "succeeded" item as finished will quietly count refusals as completed work. Inspect each succeeded item’s message for stop_reason: "refusal" or stop_details.type. Collect the declined items separately. Batch refusals carry the same policy details but never a fallback_credit_token.

Adding fallbacks to a batch request produces a per-item error. Resubmit eligible refused items in a new batch or as direct requests on a fallback model. If the item sent thinking: {"type": "between_tools"}, omit that setting or use one the fallback accepts. Only Claude Sonnet 5.5 accepts that value. Refusals in Message Batches

What to check before shipping

An HTTP error-rate alert never sees a classifier refusal. Emit a refusal event for each decline and a separate event for each fallback-served response. Alert on the gap, as Anthropic recommends. Keep enough context to distinguish a new decline, a final refusal and a later sticky turn when investigating that gap. Anthropic’s common pitfalls

  • Branch on stop_reason or stop_details.type. A null category, changing explanation or empty content makes a poor control signal.
  • Reissuing the identical request to the same model usually produces another refusal. Use the documented fallback policy and handle a final decline visibly.
  • Budget retries per request. An agent and its subagents can each encounter a refusal within one user turn.
  • Configure fallback on every request path, including background workers, recovery code and retry handlers.
  • Configure calls made inside tools separately. Subagents do not inherit their parent’s fallbacks.
  • Make fallback explicit on the outgoing request. A global flag can disagree with what a recovery handler actually sent.

For deployment decisions, see Enterprise frontier safeguards, what changes with Claude Fable 5.2 and how Mythos and Fable compare.

Published
Category
Build
Related Articles
Claude Code in Action: Lessons, Enrollment and the Course Badge

Claude Code in Action: Lessons, Enrollment and the Course Badge

Find Anthropic’s nine lessons, see how to earn the Claude Academy badge, and save your old Skilljar certificate before the site closes.Nov 29, 2026Build
Obsidian MCP

Obsidian MCP

Compare six ways to read and write Obsidian notes, with a Claude Desktop config, a read-only option and the connection requirements for ChatGPT.Nov 29, 2026Build
Claude Code Hooks

Claude Code Hooks

Format an edited file, refuse a risky Bash command and attach a rule to each prompt. Includes working settings and a table of every hook event.Nov 29, 2026Build
How to fine-tune Gemma 4 on one GPU

How to fine-tune Gemma 4 on one GPU

Choose RAG, QLoRA or full tuning, check VRAM for all five Gemma 4 sizes, and follow Google’s single-GPU example from dataset to serving.Nov 28, 2026Build
Anthropic Siren: Why Agents Leave Weak Sandboxes, and What Stops Them

Anthropic Siren: Why Agents Leave Weak Sandboxes, and What Stops Them

Siren tests whether Claude leaves a weakened sandbox. Describing the sandbox's rules cut that by 68% to 96%. What to set up, and what still needs a wall.Nov 28, 2026Build
Blender MCP

Blender MCP

Choose the right Blender MCP, connect it to Claude or another client, and try three scene questions before letting an assistant edit your file.Nov 28, 2026Build
Qwen 3.8 27B: Can Your Machine Run It?

Qwen 3.8 27B: Can Your Machine Run It?

Choose a Qwen 3.8 27B download for a 16 GB or 24 GB GPU or a 32 GB Mac, then start a local chat with Ollama or LM Studio.Nov 28, 2026Build
Grok Build: What It Is, What It Costs, and How to Start

Grok Build: What It Is, What It Costs, and How to Start

Install Grok Build, sign in, and ask your first question about a project. See the commands for macOS, Linux, WSL, and Windows and the model it uses.Nov 27, 2026Build
Newsletter

One letter, every Sunday.Working systems, not hot takes.

Weekly. No spam. Unsubscribe anytime.