Claude 4 stopped working, Claude 4 not working, Claude API down, Claude 4 API broken, Claude 4 deprecated, Claude 4 error June 2026, fix Claude 4 API, claude-4-opus not found">
โ† Back to blog

Claude 4 Stopped Working? Here's Exactly What to Do

Your Claude 4 API calls are failing. model not found. deprecated model. Your app is down. Here's the fastest path to fixing it โ€” and saving up to 99% on API costs while you're at it.

--
Days Left
June 15
Deadline
~5min
Fix Time
Up to 99%
Savings

TL;DR: Claude 4 Opus and Sonnet 4 retire on June 15, 2026. After that date, every API call to these models fails. The fix: replace claude-4-opus with claude-opus-4-8 or claude-sonnet-4 with claude-sonnet-4-6. Same API key, same SDK, 5-minute fix.

Step 1: Identify the Error

When Claude 4 is deprecated, you'll see one of these error responses:

Error: Model Not Found (HTTP 404)
{
  "type": "error",
  "error": {
    "type": "not_found_error",
    "message": "model 'claude-4-opus' not found"
  }
}
Error: Deprecated Model (HTTP 400)
{
  "type": "error",
  "error": {
    "type": "invalid_request_error",
    "message": "model 'claude-sonnet-4' is deprecated and no longer available"
  }
}
Error: Model Retired (HTTP 410)
{
  "type": "error",
  "error": {
    "type": "invalid_request_error",
    "message": "model 'claude-4-opus' has been retired. Use 'claude-opus-4-8' instead"
  }
}

All three errors mean the same thing: the model name you're using no longer works. The fix is identical regardless of which error you see.

Step 2: Apply the Quick Fix

Find the model name in your code and replace it. That's it.

Retired ModelReplace WithCost Change
claude-4-opus claude-opus-4-8 67% cheaper ($15/$75 โ†’ $5/$25)
claude-sonnet-4 claude-sonnet-4-6 Same price ($3/$15)

Python

# Before (broken)
client = anthropic.Anthropic()
message = client.messages.create(
    model="claude-4-opus",  # โ† THIS IS THE PROBLEM
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello"}]
)

# After (fixed)
message = client.messages.create(
    model="claude-opus-4-8",  # โ† FIXED
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello"}]
)

Node.js

// Before (broken)
const message = await anthropic.messages.create({
    model: 'claude-4-opus',  // โ† THIS IS THE PROBLEM
    max_tokens: 1024,
    messages: [{ role: 'user', content: 'Hello' }]
});

// After (fixed)
const message = await anthropic.messages.create({
    model: 'claude-opus-4-8',  // โ† FIXED
    max_tokens: 1024,
    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", ...}'  # โ† PROBLEM

# After (fixed)
curl https://api.anthropic.com/v1/messages \
  -H "x-api-key: $ANTHROPIC_API_KEY" \
  -d '{"model": "claude-opus-4-8", ...}'  # โ† FIXED
Quick Find & Replace

Search your entire codebase for these strings:

  • claude-4-opus โ†’ claude-opus-4-8
  • claude-sonnet-4 โ†’ claude-sonnet-4-6

Also check: .env files, config files, environment variables, and any hardcoded model names in database records.

No API key changes needed. Your existing Anthropic API key works with all current models. Same key, same endpoint, same SDK โ€” just a different model name string.

Step 3: Save Money While You're At It

You're already fixing the error โ€” might as well cut your bill. Claude Opus 4.8 is the direct replacement, but there are 34 cheaper alternatives.

ModelInput CostOutput CostSavings vs Claude 4 Opus
Claude 4 Opus (retired) $15.00 $75.00 โ€”
Claude Opus 4.8 (direct upgrade) $5.00 $25.00 67% cheaper
GPT-5.5 $2.50 $10.00 87% cheaper
Gemini 3.1 Pro $1.25 $5.00 93% cheaper
DeepSeek V4 Pro $0.435 $0.87 97% cheaper
DeepSeek V4 Flash $0.14 $0.28 99% cheaper

For a typical workload of 10M input + 2M output tokens per month:

Calculate your exact savings

Enter your token usage and see exactly how much you'll save by switching from Claude 4.

Deprecation Calculator โ†’ Migration Tool โ†’ Migration Cheat Sheet Cheapest LLM APIs

Step 4: If It's Still Not Working

If you've changed the model name and it's still failing, check these common issues:

1. Check your .env file

If you're using an environment variable for the model name, update it there too:

# .env
ANTHROPIC_MODEL=claude-opus-4-8  # NOT claude-4-opus

2. Check your config files

Look in config.json, settings.py, application.yml, or any other configuration file that might store the model name.

3. Check database records

If you store model names in a database (e.g., user preferences, saved configurations), update those records too:

-- Find stored Claude 4 references
SELECT * FROM configurations WHERE model LIKE '%claude-4%';

-- Update them
UPDATE configurations SET model = 'claude-opus-4-8' WHERE model = 'claude-4-opus';
UPDATE configurations SET model = 'claude-sonnet-4-6' WHERE model = 'claude-sonnet-4';

4. Clear your SDK cache

Some SDKs cache model lists. Restart your application or clear any cached model data.

5. Check rate limits

New model IDs may have different rate limits. If you're getting 429 errors after switching, check the rate limits documentation.

Still stuck? Our complete error guide covers every possible Claude 4 error code with detailed fix instructions. Our migration tool can also compare all alternatives with your exact usage pattern.

Complete Fix Checklist

1

Search your codebase

Run grep -r "claude-4-opus" . and grep -r "claude-sonnet-4" . to find every reference.

2

Replace model names

claude-4-opus โ†’ claude-opus-4-8 and claude-sonnet-4 โ†’ claude-sonnet-4-6.

3

Check config files and .env

Update any environment variables or config files that reference the old model names.

4

Update database records

If model names are stored in a database, run the UPDATE queries above.

5

Test and deploy

Test with a single API call, then deploy. No infrastructure changes needed.

6

Calculate your savings

While you're at it, see if a cheaper model fits your use case. Use our calculator โ†’

June 15 deadline: See all 34 alternatives, calculate your savings, and get migration code on our Claude 4 Deprecation Hub.

Related Resources

Don't just fix the error โ€” optimize your costs

You're already migrating. Take 2 minutes to see if a cheaper model works for your use case. Most developers save 60-99%.

Calculate Savings โ†’ Compare All Models โ†’