Back to catalog / Agent workflows
Configure model fallback and reconcile blocked-request billing
Handle classifier blocks with server-side or SDK fallback, distinguish stop reasons, and reconcile charges for requests with and without output.
Goal
Verify in low-risk test requests that fallback triggers only for configured stop reasons and produce a billing-reconciliation record.
Steps
- Use the notebook to distinguish stop reasons and record intended fallback path and retained prompt-cache prefix. [src10-anthropic-configure-classifier-model-fallback-and-reconcile-billing]
- Configure server-side fallback on the supported Claude API path; with SDK helpers, call the backup only for documented classifier-block conditions. [src10-anthropic-configure-classifier-model-fallback-and-reconcile-billing]
- Test output-bearing blocks, no-output blocks, and normal stops separately; compare usage with billing without replaying sensitive prompts. [src10-anthropic-configure-classifier-model-fallback-and-reconcile-billing]
How to verify
Each stop reason follows the planned path; fallback calls, usage, and invoice/console line items reconcile.
Troubleshooting
If backup runs for every error, narrow stop-reason conditions; for billing deltas, check whether blocked requests were billed before output and whether cache prefixes persisted.
Permissions
Prerequisites
- Anthropic API/SDK credentials, access to supported primary/backup models, low-risk test prompts, and billing-usage read access.
Permissions
- Prompts incur API charges and fallback adds calls. Route classifier blocks only to an approved model; do not bypass safety policy.
Limitations
Model and billing behavior described for Fable/Opus may change by model, region, or server-side support; verify current API docs before use.
Pinned upstream source
- Repository
- anthropics/anthropic-cookbook
- File path
- fable_5_fallback_billing/guide.ipynb
- Pinned commit
9c1e493ddd2b82df399d2a61b9c806c539e18be6- Source checked
- 2026-10-14 · Reviewed against the pinned upstream source
Repository metrics
These values describe the upstream repository, not popularity or likes for an individual skill or playbook.
- Stars
- Not collected
- Forks
- Not collected
- Observed at
- Not collected
No metrics snapshot is available yet.
License: MIT
Main topic
Take a coding Agent change from context to verification