Search your entire codebase for these model IDs:

# Search for Claude 4 model references
grep -r "claude-4-opus" . --include="*.py" --include="*.js" --include="*.ts" --include="*.json"
grep -r "claude-sonnet-4" . --include="*.py" --include="*.js" --include="*.ts" --include="*.json"

Check everywhere: source code, config files, environment variables, documentation, tests, and CI/CD pipelines. Don't forget .env files and deployment configs.

Pro tip: Also search for claude-4 as a substring — it catches any other Claude 4 variants you might have missed.

2
Update the Model Name Strings
~5 min

Replace each model reference. This is a find-and-replace operation:

Old Model IDNew Model IDPrice Change
claude-4-opus claude-opus-4-8 $15/$75 → $5/$25 (save 67%)
claude-sonnet-4 claude-sonnet-4-6 $3/$15 → $3/$15 (same price, 5x context)

That's it. No new SDK. No new API key. No new endpoint. Just a string change.

3
Test Your Integration
~30 min

Run your test suite with the new model names. Focus on:

Good news: Claude Opus 4.8 and Claude Sonnet 4.6 use the same API format as Claude 4. If your code worked before, it will work now — just with a different model name.

4
Calculate Your New Costs
~10 min

Use the APIpulse calculator to see exactly how much you'll save with the new models:

For most users, the savings are significant:

Monthly UsageClaude 4 Opus CostClaude Opus 4.8 CostSavings
1M input + 500K output tokens $52.50 $17.50 $35.00/mo (67%)
10M input + 5M output tokens $525.00 $175.00 $350.00/mo (67%)
100M input + 50M output tokens $5,250.00 $1,750.00 $3,500.00/mo (67%)
5
Deploy and Monitor
~30 min

Push your changes to production. Then monitor for 24 hours:

Rollback plan: If something goes wrong, you can switch back instantly — just change the model name back. But do this by June 15, because after that the old model IDs stop working entirely.

What If You Want to Switch Providers Entirely?

The steps above keep you on Anthropic. But if you want to explore cheaper alternatives, here are the best options:

AlternativePrice (In/Out per M)Savings vs Claude 4 OpusBest For
DeepSeek V4 Pro $0.435 / $0.87 97% cheaper Cost-sensitive, code, analysis
Gemini 2.5 Pro $1.25 / $10.00 92% cheaper Long context, multimodal
GPT-5 $1.25 / $10.00 87% cheaper General purpose, function calling
Claude Opus 4.8 $5.00 / $25.00 67% cheaper Drop-in replacement, best quality

Use the Migration Tool to compare all 67 alternatives side by side with your exact usage.

Quick FAQ

Will my API key stop working?

No. Your Anthropic API key works with all Anthropic models, including the new ones. You don't need a new key.

Do I need to update my SDK?

No. The Anthropic SDK works with all Claude models. Just change the model name string.

What if I'm using a third-party proxy (OpenRouter, LiteLLM, etc.)?

Check your proxy's documentation — they may handle the model mapping automatically. If not, update the model name in your proxy config.

Can I keep using Claude 4 after June 15?

No. The model IDs were retired and return errors. There's no extended support or grace period.

What about Claude 4 Opus on claude.ai (the web interface)?

This deprecation only affects the API. The claude.ai web interface manages its own model availability separately.

Ready to migrate?

Calculate your exact savings and get the code changes you need.

Deprecation Calculator → Migration Tool →

Related Resources

🎯 Rate Your API Setup in 30 Seconds

Get an A+ to F grade on your AI API costs. See how you compare and find cheaper alternatives instantly.

Get Your Cost Score →

📊 Generate Your Personalized API Cost Report

Select your model, enter your monthly spend, and get a custom savings report with cheaper alternatives — free, in 60 seconds.

Want to optimize your AI API costs?

APIpulse includes free cost comparisons, exports, and recommendations that can save you up to 40%.

Free Cost Audit →
💸 Looking for Sonnet 4.6 Alternatives?
5 models ranked by cost — some are 90% cheaper.
See 5 Sonnet 4.6 Alternatives →
💸 Looking for Opus 4.8 Alternatives?
5 models ranked by cost — some are 98% cheaper.
See 5 Opus 4.8 Alternatives →
🔧 Free Embeddable Pricing Widget
Add live AI API pricing to your docs, blog, or README with one script tag. 85 models, auto-updating.
Get the Free Widget → Free MCP Server →

🔄 Need a migration toolkit?

The Claude 4 Migration Command Center has everything in one page: live countdown, savings calculator, exact code changes, decision tree, and a persistent checklist.

Open Migration Command Center →

💡 Looking for Cheaper Claude Alternatives?

5 Cheaper Claude Alternatives → Save 40-98%

🚨 Claude 4 Is Down — Getting 410 Errors?

Get the 5-minute fix guide →