refusals-and-fallback changedbuild-with-claude/refusals-and-fallback
Nearest release: v2.1.301, published 5 hours before 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+8added
Lines−12removed
From line
782
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits23to this page, all time
The whole hunk
from line 782, old and new numbered
/
from line 782
782782
783783Pass `BetaRefusalFallbackMiddleware` (typescript: `betaRefusalFallbackMiddleware`; go: `betafallback.BetaRefusalFallbackMiddleware`; csharp: `BetaRefusalFallbackHandler`; java: `BetaRefusalFallbackInterceptor`; php: `RefusalFallbackMiddleware`) to the client constructor, and share one `BetaFallbackState` instance across the requests of a conversation.
784784
785<CodeGroup>
786 ```bash cURL
787 # The refusal-fallback middleware is an SDK feature. See the
788 # server-side fallback section for the equivalent single-request approach,
789 # or the fallback credit page for the raw HTTP retry pattern.
790 ```
785<CodeGroup exclude="shell">
786 <CodeGroupItem language="cURL">
787 The refusal-fallback middleware is part of the Claude SDK, so a cURL request can't use it. To fall back within a single request, use [server-side fallback](https://platform.claude.com/docs/en/build-with-claude/refusals-and-fallback#server-side-fallback). To write the retry yourself, see [Fallback credit](https://platform.claude.com/docs/en/build-with-claude/fallback-credit).
788 </CodeGroupItem>
791789
792 ```bash CLI
793 # The refusal-fallback middleware is an SDK feature. See the
794 # server-side fallback section for the equivalent single-request approach,
795 # or the fallback credit page for the raw HTTP retry pattern.
796 ```
790 <CodeGroupItem language="CLI">
791 The `ant` CLI doesn't include the refusal-fallback middleware. To fall back within a single request, use [server-side fallback](https://platform.claude.com/docs/en/build-with-claude/refusals-and-fallback#server-side-fallback). To write the retry yourself, see [Fallback credit](https://platform.claude.com/docs/en/build-with-claude/fallback-credit).
792 </CodeGroupItem>
797793
798794 ```python Python
799795 from anthropic import Anthropic, BetaFallbackState, BetaRefusalFallbackMiddleware
No line in this hunk matches that.