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.
Replace each model reference. This is a find-and-replace operation:
| Old Model ID | New Model ID | Price 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.
Run your test suite with the new model names. Focus on:
- API calls succeed (no 410 Gone or 400 errors)
- Response format is compatible (it should be — same Anthropic API)
- Token limits work correctly (new models have larger context windows)
- Streaming responses work if you use streaming
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.
Use the APIpulse calculator to see exactly how much you'll save with the new models:
- Cost Calculator — input your token usage, see monthly costs
- Deprecation Calculator — compare old vs new costs
- Provider Switch Calculator — see savings from switching providers
For most users, the savings are significant:
| Monthly Usage | Claude 4 Opus Cost | Claude Opus 4.8 Cost | Savings |
|---|---|---|---|
| 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%) |
Push your changes to production. Then monitor for 24 hours:
- Check error rates — should be zero new errors
- Check response times — should be similar or better
- Check your API dashboard — confirm the new model names appear
- Check costs — confirm the lower pricing kicks in
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:
| Alternative | Price (In/Out per M) | Savings vs Claude 4 Opus | Best 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 →