Claude 4 Is Deprecated — Here's What to Do
Claude 4 Opus and Claude Sonnet 4 were retired on June 15, 2026. If your code still uses these models, your API calls are failing. Here's how to fix it — and save 67-97% in the process.
Migration in 3 Steps
1
Find your Claude 4 model references
Search your codebase for
claude-4-opus, claude-opus-4, claude-sonnet-4, or claude-4-sonnet. These are the deprecated model names.2
Replace with the new model name
The API format is identical — just change the model parameter:
- model: "claude-4-opus"
+ model: "claude-opus-4-8"
- model: "claude-sonnet-4"
+ model: "claude-sonnet-4-6"
+ model: "claude-opus-4-8"
- model: "claude-sonnet-4"
+ model: "claude-sonnet-4-6"
3
Test and deploy
Your existing prompts, system messages, and API format work without changes. Deploy the update and verify your API calls succeed.
Tools & Resources
Top Alternatives to Claude 4
Claude Opus 4.8
Anthropic
$5/$25
67% cheaper than Claude 4 Opus
Recommended
Gemini 3.1 Pro
Google
$2/$12
87% cheaper, 1M context
Best Value
GPT-5.5
OpenAI
$5/$30
73% cheaper on input
Premium
DeepSeek V4 Pro
DeepSeek
$0.44/$0.87
97% cheaper — lowest cost
Cheapest
Frequently Asked Questions
Will my Claude 4 API calls start working again?
No. Claude 4 Opus and Sonnet 4 are permanently retired. You need to update your model name to Claude Opus 4.8 or Claude Sonnet 4.6. The API format is identical — just change the model parameter.
Do I need to rewrite my prompts?
No. Claude Opus 4.8 and Sonnet 4.6 use the same API format, prompt structure, and system message format. Your existing code works with just a model name change.
What if I need the cheapest possible option?
DeepSeek V4 Flash ($0.14/$0.28) is 99% cheaper than Claude 4 Opus. Gemini 2.0 Flash ($0.10/$0.40) is even cheaper on input tokens. Use the Provider Switch Calculator to see exact costs for your usage.
Can I use multiple models for different tasks?
Yes — and you should. Use budget models (DeepSeek V4 Flash, Gemini Flash) for simple tasks like classification and summarization, and premium models (Claude Opus 4.8, GPT-5.5) for complex reasoning. The AI Stack Cost Optimizer helps you find the cheapest combination.
Need help choosing?
Answer 4 questions and get a personalized AI model recommendation with cost estimates.
Try the AI Model Decision Tree →