Agent Wealth HubFree public resources
中文 EN العربية

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

  1. 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]
  2. 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]
  3. 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

Permissions

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

https://github.com/anthropics/anthropic-cookbook/blob/9c1e493ddd2b82df399d2a61b9c806c539e18be6/fable_5_fallback_billing/guide.ipynb

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

Related resources