Anthropic is retiring Claude Sonnet 4 and Opus 4 on June 15, 2026 — here's what you need to do
Anthropic retires claude-sonnet-4-20250514 and claude-opus-4-20250514 from the API on June 15, 2026. Pinned version strings will error. Here's how to migrate.
If your code or applications are making API calls to claude-sonnet-4-20250514 or claude-opus-4-20250514, mark June 15, 2026 in your calendar now. On that date at 9AM PT, both model identifiers retire from the Claude API. Calls using those strings will return errors. There is no automatic fallback to a newer model.
Anthropic announced the deprecation on April 14, 2026, giving developers roughly 60 days notice, which aligns with their standard policy for publicly released models. The retirement applies to the Claude API, Claude Platform on AWS, and Microsoft Foundry. If you’re running Claude on Amazon Bedrock or Vertex AI, those platforms set their own retirement schedules independently, so check there separately.
What’s being retired and why
Both models originally launched on May 14, 2025, as part of the Claude 4 generation. They were notable at the time for unifying extended thinking and multi-tool use in a single generation, and for about a year they were the default choice for production API workloads.
Since then, Anthropic has shipped several subsequent versions that outperform them on reasoning, instruction following, long-context handling, and agentic tasks. Keeping older version strings live indefinitely creates infrastructure overhead and fragments developer attention. Deprecation is how Anthropic consolidates that. For context, the entire Claude 3 generation, and Claude 3.5 and 3.7, have all fully retired already. The Claude 4.x deprecation cycle is following the same pattern.
Where to migrate
Anthropic’s official migration guide recommends these direct replacements:
- Claude Sonnet 4 (
claude-sonnet-4-20250514) should migrate to Claude Sonnet 4.6, which delivers near-Opus-level performance on coding and document tasks, significantly improved computer use capabilities, and a 1 million token context window in beta. - Claude Opus 4 (
claude-opus-4-20250514) should migrate to Claude Opus 4.7, which scored 87.6% on SWE-bench, includes Adaptive Thinking, and has a 36% reduction in hallucination rate compared to earlier versions.
In most cases the migration is a one-line change: update the model string, run your test suite against the new model, check that outputs still meet your expectations, and deploy. That said, there are a few things worth knowing before you just swap the string and ship.
A few things to check before you migrate
Extended thinking has changed. Extended thinking is deprecated in the Claude 4.6 models and removed entirely in Claude Opus 4.7. If your application relied on extended thinking, you will need to switch to Adaptive Thinking instead. This is not a drop-in replacement in terms of how you invoke it, so budget time to test that path specifically.
The 1M token context window moved. Anthropic retired the 1M token context window beta for Claude Sonnet 4 and Sonnet 4.5 on April 30, 2026. The context-1m-2025-08-07 beta header no longer works on those models. If you were using it, Claude Sonnet 4.6 or Claude Opus 4.6 are the supported paths for 1M context going forward.
Max output tokens got a significant upgrade. The newer models support up to 300k output tokens on the Message Batches API via the output-300k-2026-03-24 beta header. If you’re doing long-form generation, structured data extraction, or large code generation tasks, this is worth knowing about.
Deprecation warnings are in response headers. Anthropic sends a model-deprecated warning in API response headers before hard retirement. If you are not logging response headers in your application, you will not see that warning until calls start failing. It is worth adding header logging now if you have not already.
If you’re using the Claude Agent SDK
This deprecation affects Agent SDK deployments too. If your agents are explicitly parameterized with claude-opus-4-20250514 or claude-sonnet-4-20250514, those configurations need updating before June 15. The SDK does not automatically alias deprecated model strings to successors.
There is also a billing change landing on the same date. The Claude Agent SDK will stop drawing from Pro, Max, Team, or Enterprise plan quotas and will switch to a separate monthly credit. These two changes land simultaneously, so if you have automated pipelines using these model strings, you could face both broken API calls and unexpected billing behaviour on the same day if you do not act before the deadline.
How to find your exposure quickly
Do a global search across your codebase for 20250514. That date string appears in both deprecated model identifiers and is the fastest way to surface every place you have pinned these versions. Check configuration files, environment variables, infrastructure-as-code templates, and any agent definitions in addition to application code. Scheduled jobs and automated pipelines are the most common places teams miss.
Deadlines are firm
Anthropic has not extended deprecation deadlines in previous cycles. Claude 3 Opus retired on January 5, 2026 as announced. Claude 3.5 Sonnet and Claude 3.7 Sonnet retired on February 19, 2026 as announced. The June 15 date for Sonnet 4 and Opus 4 will follow the same pattern.
If you have pinned these model strings anywhere in your stack, the migration is genuinely straightforward in most cases. The main risk is not complexity, it is teams that assume there will be a grace period or automatic fallback. There will not be. A call to a retired model ID returns an error, and that is the full story.
The full list of currently active, non-deprecated models, the recommended migration targets, and the official retirement schedule are maintained on Anthropic’s model deprecations page.