Claude 4 Migration Cheat Sheet
Everything you need to switch in under 60 seconds. Bookmark this page.
TL;DR โ What to switch to
The 1-Line Code Change
If you're staying with Anthropic, your API key and SDK don't change. Just update the model string:
client = anthropic.Anthropic()
# Before (retired June 15):
response = client.messages.create(
model="claude-4-opus-20250514",
...
)
# After (recommended):
response = client.messages.create(
model="claude-opus-4-8-20260115",
...
)
// Before:
model: "claude-4-opus-20250514"
// After:
model: "claude-opus-4-8-20260115"
# Install: pip install openai
client = openai.OpenAI(
api_key="your-deepseek-key",
base_url="https://api.deepseek.com/v1"
)
response = client.chat.completions.create(
model="deepseek-v4-pro",
...
)
Cost Comparison (per 1M tokens)
| Model | Provider | Input | Output | Context | vs Claude 4 Opus |
|---|---|---|---|---|---|
| Claude 4 Opus | Anthropic | $15.00 | $75.00 | 200K | โ |
| Claude Sonnet 4 | Anthropic | $3.00 | $15.00 | 200K | โ |
| Claude Opus 4.8 | Anthropic | $5.00 | $25.00 | 1M | -67% |
| Claude Sonnet 4.6 | Anthropic | $3.00 | $15.00 | 1M | -80% input |
| Claude Haiku 4.5 | Anthropic | $1.00 | $5.00 | 200K | -93% |
| GPT-5 | OpenAI | $1.25 | $10.00 | 272K | -87% |
| GPT-5 mini | OpenAI | $0.25 | $2.00 | 272K | -97% |
| Gemini 2.5 Pro | $1.25 | $10.00 | 1M | -87% | |
| DeepSeek V4 Pro | DeepSeek | $0.435 | $0.87 | 1M | -97% |
| DeepSeek V4 Flash | DeepSeek | $0.14 | $0.28 | 1M | -99% |
| Mistral Large 3 | Mistral | $0.50 | $1.50 | 262K | -97% |
| Llama 4 Maverick | Meta (Together.ai) | $0.27 | $0.85 | 1M | -98% |
Which replacement should you pick?
Migration Checklist
- Identify all places in your code that reference claude-4-opus or claude-sonnet-4
- Choose your replacement model (see decision tree above)
- Update the model name string in your code
- If switching providers: get a new API key and update base_url
- Test with a small request to verify the new model works
- Run your full test suite against the new model
- Update any hardcoded token limits (new models may have different defaults)
- Monitor costs for the first few days to verify expected savings
- Update your documentation and team runbooks
- Remove deprecated model references from config files
Status: Claude 4 models were retired June 15, 2026. API calls to Claude 4 models now return errors.
Calculate your exact savings
Use the APIpulse migration tool to enter your current Claude 4 usage and see exactly how much you'll save with each alternative โ down to the penny.
Free Migration Calculator Free Audit โ Save More โAll users get optimization recommendations that save up to 40% more. 100% free.
Want this as an email checklist?
Get the complete migration checklist emailed to you โ with code snippets, cost comparisons, and a deadline tracker.
Get the Free Checklist โMore Claude 4 migration resources:
๐ด Claude 4 Has Been Shut Down โ Read the Latest: