Your Claude 4 integration is broken. As of June 15, 2026, Anthropic has retired Claude 4 Opus and Claude 4 Sonnet. Every API call to these models returns HTTP 410 Gone. There's no grace period, no extension, and no way to reverse it.
The good news: the fix takes about 15 minutes. The API format is identical. You change the model ID, deploy, and you're back online. Here's exactly how.
What Happened
Anthropic retired two models on June 15, 2026:
- Claude 4 Opus — was $15/M input, $75/M output, 200K context — RETIRED
- Claude 4 Sonnet — was $3/M input, $15/M output, 200K context — RETIRED
These models are not affected: Claude Opus 4.8, Claude Opus 4.7, Claude Sonnet 4.6, Claude Haiku 4.5. Only the "Claude 4" branded models were retired.
The 15-Minute Fix
Replace the model ID (5 minutes)
Find every file that references claude-4-opus or claude-4-sonnet and replace with the successor:
Python (Anthropic SDK)
# ❌ BROKEN — returns HTTP 410 Gone
import anthropic
client = anthropic.Anthropic()
response = client.messages.create(
model="claude-4-opus-20250415",
max_tokens=4096,
messages=[{"role": "user", "content": "Hello"}]
)
# ✅ FIXED — Claude Opus 4.8 (67% cheaper)
import anthropic
client = anthropic.Anthropic()
response = client.messages.create(
model="claude-opus-4-8-20250601",
max_tokens=4096,
messages=[{"role": "user", "content": "Hello"}]
)
Node.js (Anthropic SDK)
// ❌ BROKEN
const response = await anthropic.messages.create({
model: "claude-4-opus-20250415",
max_tokens: 4096,
messages: [{ role: "user", content: "Hello" }]
});
// ✅ FIXED
const response = await anthropic.messages.create({
model: "claude-opus-4-8-20250601",
max_tokens: 4096,
messages: [{ role: "user", content: "Hello" }]
});
curl
# ❌ BROKEN
curl https://api.anthropic.com/v1/messages \
-H "model: claude-4-opus-20250415"
# ✅ FIXED
curl https://api.anthropic.com/v1/messages \
-H "model: claude-opus-4-8-20250601"
Sonnet migration
# ❌ BROKEN
model="claude-4-sonnet-20250415"
# ✅ FIXED
model="claude-sonnet-4-6-20250601"
Test with a single request (5 minutes)
Before deploying to production, send one test request to verify the model ID works and your API key is valid. The response format is identical — no parsing changes needed.
Deploy and monitor (5 minutes)
Push to production. Watch your error rates for 15 minutes. If you still see HTTP 410 errors, you missed a model ID reference. Search your codebase for claude-4- to find any remaining references.
Better Option: Save 90%+ by Switching Providers
The successor models work, but this is also a chance to dramatically cut costs. Claude 4 Opus cost $15/$75 per 1M tokens. Modern alternatives are 97-99% cheaper:
- Gemini 2.0 Flash Lite — $0.075/$0.30 (99.6% cheaper, Google, 1M context)
- DeepSeek V4 Flash — $0.14/$0.28 (99% cheaper, 1M context)
- Llama 4 Maverick — $0.27/$0.85 (98% cheaper, open source MIT, 1M context)
- DeepSeek V4 Pro — $0.44/$0.87 (97% cheaper, 1M context)
- Claude Haiku 4.5 — $1/$5 (93% cheaper, same Anthropic API, 200K context)
- Gemini 2.5 Pro — $1.25/$10 (92% cheaper on output, 1M context)
Switch to Llama 4 Maverick (98% cheaper)
# Using Together.ai API
import together
client = together.Together(api_key="your-key")
response = client.chat.completions.create(
model="meta-llama/Llama-4-Maverick-17B-128E-Instruct",
messages=[{"role": "user", "content": "Hello"}]
)
# Cost: $0.27/M input, $0.85/M output
# vs Claude 4 Opus: $15/M input, $75/M output
# Savings: 98%
Switch to DeepSeek V4 Pro (97% cheaper)
# Using DeepSeek API (OpenAI-compatible)
import openai
client = openai.OpenAI(
api_key="your-deepseek-key",
base_url="https://api.deepseek.com"
)
response = client.chat.completions.create(
model="deepseek-v4-pro",
messages=[{"role": "user", "content": "Hello"}]
)
# Cost: $0.44/M input, $0.87/M output
# Savings: 97%
Find Your Cheapest Replacement
Use the APIpulse cost calculator to compare all 39 models with your exact usage pattern.
Calculate Your Savings →Why Did Anthropic Retire Claude 4?
Anthropic regularly retires older model versions to focus resources on newer, more capable models. Claude 4 Opus and Sonnet launched in April 2025 and were superseded by Claude Opus 4.8 and Claude Sonnet 4.6 in June 2025. The newer models are cheaper, faster, and support 5x larger context windows (1M vs 200K).
This pattern is common across all providers. OpenAI retired GPT-4 in favor of GPT-5. Google retired Gemini 1.0 in favor of 2.0. Model deprecations are the norm, not the exception. If you're building on any AI API, you need a migration plan.
How to Prevent This Next Time
- Subscribe to provider deprecation notices — Anthropic, OpenAI, and Google all announce retirements 30-90 days in advance.
- Use model aliases when available — Some providers offer version-agnostic aliases that auto-resolve to the latest model.
- Monitor your error rates — Set up alerts for HTTP 410 (Gone) and HTTP 400 (Bad Request) spikes. These are the first signs of a deprecation.
- Bookmark APIpulse — We track all model deprecations, price changes, and migrations across 10 providers.
Never Get Caught Off Guard Again
Get notified when models are deprecated, prices change, or new alternatives launch. Join 2,400+ developers.
See All 39 Models →Quick Reference: All Retired Model IDs
If you're searching your codebase, here are all the model strings that are now broken:
# All return HTTP 410 Gone as of June 15, 2026:
claude-4-opus-20250415
claude-4-opus
claude-4-sonnet-20250415
claude-4-sonnet
# Replace with:
claude-opus-4-8-20250601 # was $15/$75 → now $5/$25 (67% cheaper)
claude-sonnet-4-6-20250601 # was $3/$15 → now $3/$15 (same price, 5x context)
The Bottom Line
Claude 4 is gone. Your integration is broken. The fix is 15 minutes away — change the model ID, test, deploy. The successor models are actually cheaper and more capable.
If you want to go further, switch to a non-Anthropic provider and save 90-99%. Llama 4 Maverick costs $0.27/$0.85 — that's 98% less than what you were paying for Claude 4 Opus.
Either way, fix it now. Every hour your integration is down is lost revenue and broken user trust.