Follow Discord
Sweep 24 Nov 2026 · 22:58Z Build v2.1.332 549 read Stable v2.1.325 Latest v2.1.331 Next v2.1.332 Feeds RSS JSON llms.txt llms-full.txt Unofficial
One change · api

fallback-credit changedbuild-with-claude/fallback-credit

Nearest release: v2.1.332, published 6 hours after this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.

Recorded here
Lines+10added
Lines−8removed
From line 50 where the diff opens
First seen 14 Aug 2026 this site's first read of the page
Recorded edits27to this page, all time

The whole hunk

from line 50, old and new numbered
/
lines
from line 50
5050 </Step>
5151 
5252 <Step title="Build the retry">
53 Start from the refused request body. Set `model` to the fallback model and add the token as the top-level `fallback_credit_token` parameter. Pick the body shape from the following table.
53 Start from the refused request body. Set `model` to the fallback model and add the token as the top-level `fallback_credit_token` parameter. If the request used fast mode, delete `speed` (see [With a manual retry](https://platform.claude.com/docs/en/build-with-claude/refusals-and-fallback#with-a-manual-retry)). Pick the body shape from the following table.
5454 </Step>
5555 
5656 <Step title="Send the retry with the same header">
from line 62
6262 
6363| `fallback_has_prefill_claim` | Retry body |
6464| ----- | ----- |
65| `true` | The refused request body, unchanged, plus one appended assistant message whose `content` echoes the refused response’s `content`. The retry model continues the response from where the refused model stopped, and completed server tool calls are not run again. |
66| `false` | The refused request body, unchanged. |
65| `true` | The body you built, plus one appended assistant message whose `content` echoes the refused response’s `content`. The retry model continues the response from where the refused model stopped, and completed server tool calls are not run again. |
66| `false` | The body you built. |
6767 
6868## Example
6969 
from line 550
550550Most retries redeem on the first attempt. When one does not, the API returns a 400 error that tells you what to try next.
551551 
552552<Steps>
553 <Step title="Continuation rejected: resend the unchanged body">
554 If the retry that appends the assistant message is rejected with a 400 error, resend the refused request body unchanged, still with the token.
553 <Step title="Continuation rejected: remove the assistant message">
554 If the retry that appends the assistant message is rejected with a 400 error, resend it without that message, still with the token. The rest of this page calls this the unchanged body.
555555 </Step>
556556 
557557 <Step title="Token rejected: drop the token">
from line 578
578578 | ----- | ----- |
579579 | Must match exactly | `system`, `messages`, `tools`, `tool_choice`, `thinking`, and `cache_control`, plus `output_config`, `mcp_servers`, `context_management`, and `container` when you use them |
580580 | May change on the retry | `model`, `max_tokens`, `stop_sequences`, `stream`, `metadata`, and `service_tier` |
581 | May be deleted, not added | `speed`: delete it to run at standard speed. `"fast"` can stay only where the retry model has fast mode. [With the SDK middleware](https://platform.claude.com/docs/en/build-with-claude/refusals-and-fallback#with-the-sdk-middleware), set `speed` to null on each fallback entry instead. |
581582 
582583 The continuation shape (`fallback_has_prefill_claim: true`) is the one exception to the `messages` match: it adds exactly one assistant message at the end of `messages`.
583584 
from line 586
585586</Accordion>
586587 
587588<Accordion title="Beta headers must match too">
588 Send the same `anthropic-beta` headers on the retry as on the refused request. A beta header present on one of the two requests but not the other can fail the match even when the bodies are identical. The resulting 400 error carries the same `request body ... does not match` message as a body difference, so a header difference is easy to misread as a body problem. In particular, do not add or drop beta headers based on which model the request targets.
589 Send the same `anthropic-beta` headers on the retry as on the refused request. A beta header present on one of the two requests but not the other can fail the match even when the bodies are identical. The resulting 400 error carries the same `request body ... does not match` message as a body difference. A header difference is therefore easy to misread as a body problem. Apart from the three kinds that follow, do not add or drop beta headers based on which model the request targets.
589590 
590 Two header families are exempt from the match, for the retry’s sake:
591 Three kinds of header are exempt from the match:
591592 
592593 * **`server-side-fallback-*`:** a retry must drop the `fallbacks` parameter, and dropping this header along with it does not cause a mismatch.
593594 * **`fallback-credit-*`:** keep this header on both requests. The retry needs it to redeem the token.
595 * **`fast-mode-2026-02-01`:** on the Claude API, a retry can add or drop this header. On Claude Models on Google Cloud (Google managed), a retry must leave it out.
594596 
595597 <Note>
596598 On models that include the 1M token context window by default, such as Claude Fable 5.2, Claude Fable 5.1, Claude Fable 5, Claude Opus 5.5, Claude Opus 5, Claude Opus 4.8, Claude Sonnet 5.5, and Claude Sonnet 5, the `context-1m-2025-08-07` beta header has no effect. To keep the two requests identical, omit that header on both rather than sending it on one and not the other.
Feedback