The Error You're Seeing
If your application suddenly started failing with a 410 Gone error, here's what the response looks like:
{
"error": {
"type": "gone",
"message": "The model 'claude-4-opus-20250615' has been retired.
Please migrate to claude-opus-4-8 or visit
https://anthropic.com/models for alternatives."
}
}
This isn't a bug. Anthropic retired Claude 4 Opus and Claude Sonnet 4 on June 15, 2026. The models are permanently offline. There is no fix other than migrating to a newer model.
The good news: the fix takes 5 minutes and costs 67-97% less.
The 5-Minute Fix
Find the retired model IDs in your code
Search your codebase for these strings. They're usually in one config file or API call:
claude-4-opus-20250615claude-4-opusclaude-sonnet-4-20250514claude-sonnet-4
Replace with the new model ID
If you want to stay with Anthropic (simplest option โ same API key, same SDK):
- model: "claude-4-opus-20250615" + model: "claude-opus-4-8" // That's it. Same API key, same SDK, same everything. // Claude Opus 4.8 is 67% cheaper with better performance.
If you want to save the most money (switch to DeepSeek โ 97% cheaper):
- model: "claude-4-opus-20250615" + model: "deepseek-v4-pro" - base_url: "https://api.anthropic.com/v1" + base_url: "https://api.deepseek.com/v1" // Requires DeepSeek API key from platform.deepseek.com // 97% cheaper. Similar quality to Claude 4 Opus.
Redeploy and test
Deploy your changes and make a test API call. That's it โ you're done.
- โ Same API key (if staying with Anthropic)
- โ Same SDK and code structure
- โ Same response format
- โ No configuration changes needed
Code Examples by Language
Python (OpenAI SDK compatible)
# Before (broken)
import anthropic
client = anthropic.Anthropic()
message = client.messages.create(
model="claude-4-opus-20250615", # โ RETIRED
messages=[{"role": "user", "content": "Hello"}]
)
# After (working) โ same SDK, just change the model name
import anthropic
client = anthropic.Anthropic()
message = client.messages.create(
model="claude-opus-4-8", # โ NEW
messages=[{"role": "user", "content": "Hello"}]
)
Node.js / TypeScript
// Before (broken)
const response = await anthropic.messages.create({
model: "claude-sonnet-4-20250514", // โ RETIRED
messages: [{ role: "user", content: "Hello" }]
});
// After (working)
const response = await anthropic.messages.create({
model: "claude-sonnet-4-6", // โ NEW
messages: [{ role: "user", content: "Hello" }]
});
cURL
# Before (broken)
curl https://api.anthropic.com/v1/messages \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-d '{"model": "claude-4-opus-20250615", "messages": [{"role": "user", "content": "Hello"}]}'
# After (working)
curl https://api.anthropic.com/v1/messages \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-d '{"model": "claude-opus-4-8", "messages": [{"role": "user", "content": "Hello"}]}'
Alternatives Comparison
If you want to stay with Anthropic, just change the model name. If you want to save money, here are your options ranked by cost:
| Model | Input / Output (per 1M tokens) | Savings vs Claude 4 Opus |
|---|---|---|
| Claude 4 Opus (RETIRED) | $15.00 / $75.00 | โ |
| Claude Opus 4.8 (Anthropic) | $5.00 / $25.00 | 67% cheaper |
| Claude Sonnet 4.6 (Anthropic) | $3.00 / $15.00 | 80% cheaper |
| GPT-5 (OpenAI) | $1.25 / $10.00 | 92% cheaper |
| Gemini 2.5 Pro (Google) | $1.25 / $10.00 | 90% cheaper |
| DeepSeek V4 Pro (DeepSeek) | $0.44 / $0.87 | 97% cheaper |
| DeepSeek V4 Flash (DeepSeek) CHEAPEST | $0.14 / $0.28 | 99% cheaper |
๐ก Pro tip: Use our Cost Calculator to find the cheapest model for YOUR specific token usage. Enter your monthly tokens and see exactly what you'd pay with each provider.
Why This Happened
Anthropic announced the retirement of Claude 4 models months in advance. The shutdown date was June 15, 2026. If you're seeing this error, it means your code was still calling the old model IDs after the deadline.
The newer models (Claude Opus 4.8, Claude Sonnet 4.6) are faster, cheaper, and better โ there's no reason to stay on the old versions. The migration is purely a model ID change.
Prevent Future Breakage
To avoid this happening again:
- Subscribe to Anthropic's model announcements โ they announce deprecations months in advance
- Use environment variables for model IDs โ
ANTHROPIC_MODEL=claude-opus-4-8makes future changes trivial - Set up cost alerts โ APIpulse Pro notifies you when provider prices change
- Review your API dependencies quarterly โ check for deprecated models and outdated SDK versions
๐งฎ Calculate Your Savings
Enter your Claude 4 usage and see what you'd pay with each alternative. Most developers save 67-97%.
Open Cost Calculator โ๐ Get a Personalized Migration Plan
Pro analyzes your exact token usage and shows you the optimal provider โ with saved scenarios, cost reports, and optimization recommendations.