CLAUDE LABJP
BILLING — The Jun 15 change is now live: Agent SDK, headless runs, GitHub Actions, and third-party agents leave subscription limits for separate monthly credits ($20/$100/$200) metered at full API rates, no rolloverRETIRED — As of today, Sonnet 4 and Opus 4 are retired from the API; scripts referencing older models should switch to the latest generation such as Opus 4.8EXPORT — Claude Fable 5 and Mythos 5 are suspended for all foreign nationals under a US export-control directive (Jun 12); Anthropic calls it a misunderstanding and is working to restore accessSAFE — Only the two new Mythos-class models are affected; every other model including Opus 4.8 keeps running normallySUBAGENTS — Claude Code sub-agents can now spawn their own sub-agents (up to 5 levels), and Dynamic workflows arrived in research previewINCIDENT — A Jun 5 outage raised error rates across claude.ai, the API, Claude Code, and Cowork, a reminder to design retries and fallbacks into automated runsBILLING — The Jun 15 change is now live: Agent SDK, headless runs, GitHub Actions, and third-party agents leave subscription limits for separate monthly credits ($20/$100/$200) metered at full API rates, no rolloverRETIRED — As of today, Sonnet 4 and Opus 4 are retired from the API; scripts referencing older models should switch to the latest generation such as Opus 4.8EXPORT — Claude Fable 5 and Mythos 5 are suspended for all foreign nationals under a US export-control directive (Jun 12); Anthropic calls it a misunderstanding and is working to restore accessSAFE — Only the two new Mythos-class models are affected; every other model including Opus 4.8 keeps running normallySUBAGENTS — Claude Code sub-agents can now spawn their own sub-agents (up to 5 levels), and Dynamic workflows arrived in research previewINCIDENT — A Jun 5 outage raised error rates across claude.ai, the API, Claude Code, and Cowork, a reminder to design retries and fallbacks into automated runs
Articles/API & SDK
API & SDK/2026-06-15Advanced

Centralizing the anthropic-beta Header So a Retired Beta Won't Kill Your Batch

Scattered anthropic-beta headers turn a beta retirement or GA graduation into a 400 that takes down an entire batch. A small capability registry, a startup preflight, and tiered fallback keep your pipeline running across feature generations.

Claude API70Anthropic SDK3Beta FeaturesProduction17Resilience

Premium Article

On June 15, 2026, Sonnet 4 and Opus 4 retired from the API, and in the same week Fable 5 and Mythos 5 were temporarily pulled. Swapping a model ID is easy to notice. What is easy to miss is the anthropic-beta header. In the backend that drives automated publishing across my four sites, I came in one morning to find that the overnight batch had not completed a single article. The cause was a call still sending context-1m-2025-08-07, a beta identifier I had written half a year earlier. The moment the beta window closed, that call started returning 400 Bad Request.

The painful part was that this one line did not break a single request. It took down every call that happened to share the same header string. Beta features are useful, but they turn over quickly: retirement, GA graduation, and renames all happen on a scale of months. The point of this article is to absorb that churn in exactly one place, by treating anthropic-beta as a capability registry and wrapping it with a startup preflight and tiered fallback.

How one beta header took down the whole overnight batch

The first implementation looked like what most people write. Calls that wanted long context and prompt caching set the header inline, every time.

# Before: header hard-coded per call, copied around, drifting apart
resp = client.messages.create(
    model="claude-opus-4-8",
    max_tokens=4096,
    messages=messages,
    extra_headers={
        "anthropic-beta": "context-1m-2025-08-07,prompt-caching-2024-07-31"
    },
)

The problem with this is that the same string was copied into the article-generation, summarization, tagging, and translation modules until it lived in 14 places. When context-1m-2025-08-07 stopped being accepted, I could not say which of those 14 was responsible without grepping. While I fixed them one by one, the batch stayed down. A single missed overnight run can be recovered by hand the next morning, but once it happens once or twice a week, the reliability of the whole operation starts to feel shaky.

Why a "feature retirement" breaks the pipeline through the header

The anthropic-beta header is an explicit switch that turns on a feature that is not yet generally available. The trouble is that this switch can stop working for three distinct reasons.

The first is retirement. A time-boxed beta such as the 1M context window becomes an unknown identifier once its window closes, and depending on the combination it returns 400. The second is GA graduation. When something like prompt caching moves to general availability, the header is no longer needed. It is often still accepted for a while, but leaving it in place forever only carries a future rejection risk. The third is a name or date change: a dated identifier like code-execution-2025-05-22 can be superseded by a newer dated version when the spec is revised.

What all three share is a structure: things break the instant the world your code knows about drifts away from the world the API will accept. That is exactly why it pays to stop scattering the header string and express the generational change in one place.

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
Fold 14 scattered anthropic-beta strings into one Capability registry that the rest of the code never has to know about
A startup preflight that detects an unsupported beta and disables only that capability while the rest of the run proceeds
Three tiers of fallback for retirement, GA graduation, and runtime rejection, plus a structured log of every disablement
Secure payment via Stripe · Cancel anytime

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Claude Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $10 for lifetime access
View Membership →

Related Articles

API & SDK2026-05-31
Isolating Poison Messages in a Claude Async Pipeline: A Dead-Letter Queue Implementation Note
How one broken input can stall an entire batch — and how to isolate these 'poison messages' with a Cloudflare Queues dead-letter queue. Covers classifying Claude API failures and safe redrive, all from production experience.
API & SDK2026-05-29
Rewiring Claude API Observability with OpenTelemetry GenAI Conventions — A Design Memo for Model Migrations and Cost Audits
An implementation memo for rewiring production observability around Claude API to match the OpenTelemetry GenAI semantic conventions — span attributes, metrics, cost tracking, and model-migration replay — written from running this in indie services for six months.
API & SDK2026-05-04
Claude API on Bun in Production: Migration Decisions and Implementation Patterns That Actually Survive Real Traffic
A practical guide to running Claude API services on Bun in production. Covers migration triggers from Node.js, built-in SQLite/WebSocket usage, streaming optimization, and the pitfalls that only surface after deployment — with working code and measured numbers.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →