🔴

Claude 4 API Was Retired on June 15, 2026

If you're seeing errors, it's because Claude 4 Opus and Sonnet 4 are permanently retired. Your API key still works — you just need to change the model name. Fix below.

Claude 4 Error? Fix It in 60 Seconds

Getting HTTP 410 Gone, "model not found", or "invalid_model_error"? Here's exactly what changed and how to fix it.

--
Days
:
--
Hours
:
--
Minutes
:
--
Seconds

The Fix — Change One Line

❌ Before (broken)
# Your current code
model = "claude-4-opus"
# Error: HTTP 410 Gone — "claude-4-opus has been deprecated"
✓ After (fixed)
# Just change the model name
model = "claude-opus-4-8"
# Works immediately. Same API key. Same SDK. Same everything else.

Language-Specific Fixes

# Before (broken)
import anthropic
client = anthropic.Anthropic()
response = client.messages.create(
    model="claude-4-opus",  # ← This line causes the error
    messages=[{"role": "user", "content": "Hello"}]
)

# After (fixed) — only the model name changes
response = client.messages.create(
    model="claude-opus-4-8",  # ← Updated
    messages=[{"role": "user", "content": "Hello"}]
)
// Before (broken)
import Anthropic from '@anthropic-ai/sdk';
const client = new Anthropic();
const response = await client.messages.create({
  model: "claude-4-opus",  // ← This line causes the error
  messages: [{ role: "user", content: "Hello" }]
});

// After (fixed) — only the model name changes
const response = await client.messages.create({
  model: "claude-opus-4-8",  // ← Updated
  messages: [{ role: "user", content: "Hello" }]
});
# Before (broken)
curl https://api.anthropic.com/v1/messages \
  -H "x-api-key: $ANTHROPIC_API_KEY" \
  -d '"model": "claude-4-opus"'  # ← Error here

# After (fixed)
curl https://api.anthropic.com/v1/messages \
  -H "x-api-key: $ANTHROPIC_API_KEY" \
  -d '"model": "claude-opus-4-8"'  # ← Fixed

Choose Your Replacement

Cheapest

DeepSeek V4 Pro

DeepSeek — 1M context
$0.435 / $0.87 per 1M tokens
97% cheaper than Claude 4 Opus
model: "deepseek-v4-pro"

GPT-5

OpenAI — 272K context
$1.25 / $10 per 1M tokens
92% cheaper than Claude 4 Opus
model: "gpt-5"

Cost Comparison — 10M Input + 2M Output / Month

Model Monthly Cost vs Claude 4 Opus
Claude 4 Opus (retired) $300/mo
Claude Opus 4.8 $100/mo 67% cheaper
GPT-5 $32.50/mo 89% cheaper
Gemini 3.1 Pro $44/mo 85% cheaper
DeepSeek V4 Pro $6.09/mo 98% cheaper

Calculate your exact savings →

Need Help Choosing?

Our free calculator compares all 39 alternatives for your specific usage. Pro users get personalized optimization tips to save up to 40% more.

Free Calculator Get Pro — $29 lifetime

14-day money-back guarantee. Lock in founding member pricing.

Related Guides

API Status Migration Tool Migration Checklist Last Chance Guide Best Alternatives