This is it. The Claude 4 deprecation deadline is June 15 — six days from now. If you're reading this on the weekend of June 14-15, you're out of time. This post is for developers who still need to migrate.
The good news: migrating from Claude 4 takes about 30 minutes. The API format is identical. You just change the model ID and deploy. Here's exactly how.
What's Being Deprecated
Two models are shutting down on June 15, 2026:
- Claude 4 Opus — $15/M input, $75/M output, 200K context
- Claude 4 Sonnet — $3/M input, $15/M output, 200K context
These are the older models. Claude Opus 4.8, Claude Sonnet 4.6, and Claude Haiku 4.5 are not affected.
Step 1: Pick Your Replacement (5 minutes)
Fastest path: Switch to the Anthropic successor. Same API, same pricing (Sonnet) or cheaper (Opus), bigger context window. Minimal code changes.
Biggest savings: Switch to a non-Anthropic model:
- Llama 4 Maverick — $0.27/$0.85 (98% cheaper, open source MIT, 1M context)
- DeepSeek V4 Pro — $0.44/$0.87 (97% cheaper, 1M context)
- Gemini 2.5 Pro — $1.25/$10 (92% cheaper on output, 1M context)
- GPT-5.5 — $5/$30 (67% cheaper on output, 1M context)
Find Your Cheapest Replacement
Use the APIpulse cost calculator to compare all 39 models with your exact usage pattern.
Calculate Your Savings →Step 2: Change the Model ID (5 minutes)
Python (Anthropic SDK)
# Before (Claude 4 — will break after June 15)
import anthropic
client = anthropic.Anthropic()
response = client.messages.create(
model="claude-4-opus-20250415", # ❌ DEPRECATED
max_tokens=4096,
messages=[{"role": "user", "content": "Hello"}]
)
# After (Claude Opus 4.8 — direct successor)
import anthropic
client = anthropic.Anthropic()
response = client.messages.create(
model="claude-opus-4-8-20250601", # ✅ ACTIVE
max_tokens=4096,
messages=[{"role": "user", "content": "Hello"}]
)
Python (Sonnet migration)
# Before (Claude 4 Sonnet)
model="claude-4-sonnet-20250415" # ❌ DEPRECATED
# After (Claude Sonnet 4.6)
model="claude-sonnet-4-6-20250601" # ✅ ACTIVE
Node.js (Anthropic SDK)
// Before
const response = await anthropic.messages.create({
model: "claude-4-opus-20250415", // ❌ DEPRECATED
max_tokens: 4096,
messages: [{ role: "user", content: "Hello" }]
});
// After
const response = await anthropic.messages.create({
model: "claude-opus-4-8-20250601", // ✅ ACTIVE
max_tokens: 4096,
messages: [{ role: "user", content: "Hello" }]
});
curl
# Before
curl https://api.anthropic.com/v1/messages \
-H "model: claude-4-opus-20250415" # ❌ DEPRECATED
# After
curl https://api.anthropic.com/v1/messages \
-H "model: claude-opus-4-8-20250601" # ✅ ACTIVE
Step 3: Update max_tokens (if needed)
The new models support up to 1M tokens of context — 5x more than Claude 4's 200K. If your application was limited by context window, you can now process much larger inputs.
# If you were hitting context limits before:
response = client.messages.create(
model="claude-opus-4-8-20250601",
max_tokens=8192, # Can go much higher now
messages=[{"role": "user", "content": long_document}]
)
Step 4: Test (10 minutes)
Run a single test request
Before deploying to production, test with a single API call to verify the model ID is correct and your API key works.
Check response format
The response format is identical between Claude 4 and the new models. No parsing changes needed. Verify your existing code handles the response correctly.
Monitor error rates
After deploying, watch your error rates for 15 minutes. If you see HTTP 410 errors, you're still using the old model ID. If you see HTTP 400 errors, check your max_tokens value.
Step 5: Deploy (5 minutes)
Push your changes to production. If you're using a staging environment, deploy there first, verify, then promote to production.
# Quick deploy check
git add .
git commit -m "Migrate from Claude 4 to Opus 4.8"
git push origin main
Alternative: Switch to a Non-Anthropic Provider
If you want to save 90%+ instead of just 67%, switch to a different provider entirely:
Llama 4 Maverick (98% cheaper)
# Using Together.ai API
import together
client = together.Together(api_key="your-key")
response = client.chat.completions.create(
model="meta-llama/Llama-4-Maverick-17B-128E-Instruct",
messages=[{"role": "user", "content": "Hello"}]
)
# Cost: $0.27/M input, $0.85/M output
# vs Claude 4 Opus: $15/M input, $75/M output
DeepSeek V4 Pro (97% cheaper)
# Using DeepSeek API (OpenAI-compatible)
import openai
client = openai.OpenAI(
api_key="your-deepseek-key",
base_url="https://api.deepseek.com"
)
response = client.chat.completions.create(
model="deepseek-v4-pro",
messages=[{"role": "user", "content": "Hello"}]
)
# Cost: $0.44/M input, $0.87/M output
Migration Checklist
- ☐ Identify all files that reference
claude-4-opusorclaude-4-sonnet - ☐ Replace model IDs with new versions
- ☐ Update
max_tokensif using >200K context - ☐ Run test requests in development
- ☐ Check error handling for HTTP 410 responses
- ☐ Deploy to staging
- ☐ Verify staging works correctly
- ☐ Deploy to production
- ☐ Monitor error rates for 15 minutes
- ☐ Update your cost tracking/budget alerts
Don't Wait Until June 15
Migrate this weekend while you have time to test properly. A Monday morning outage is worse than a Saturday afternoon migration.
Compare All Alternatives →What If I Miss the Deadline?
If you're reading this after June 15 and your integration is broken:
- Don't panic. The fix is still just changing the model ID.
- Check your error logs. Look for HTTP 410 Gone responses — those are Claude 4 calls that failed.
- Apply the same migration steps above. The model IDs are the same whether you migrate before or after the deadline.
- Consider this a wake-up call. Set up model version monitoring so you catch deprecations earlier next time.
The Bottom Line
Claude 4's deprecation is not optional. Your API calls will fail after June 15. The migration is straightforward — change the model ID, test, deploy. The biggest decision is whether to stay with Anthropic (Claude Opus 4.8, 67% cheaper) or switch providers (Llama 4 Maverick, 98% cheaper).
Either way, the 30 minutes you spend this weekend will save you from a Monday morning outage.