model_not_found

HTTP 404 Config Error Not Retryable

The model ID you specified doesn't exist or has been deprecated. Update your model string to a current versioned ID and the error disappears instantly.

What the error looks like

{
  "type": "error",
  "error": {
    "type": "not_found_error",
    "message": "model: claude-2"
  }
}

HTTP status: 404. The error type is not_found_error with the model name in the message.

Current valid model IDs (2026)

ModelIDUse case
Claude Opus 4.7claude-opus-4-7Most capable
Claude Sonnet 4.6claude-sonnet-4-6Balanced (default)
Claude Haiku 4.5claude-haiku-4-5-20251001Fastest / cheapest
Claude 3.7 Sonnetclaude-3-7-sonnet-20250219Extended thinking
Claude 3.5 Sonnetclaude-3-5-sonnet-20241022Strong baseline
Claude 3.5 Haikuclaude-3-5-haiku-20241022Fast + cheap
Claude 3 Opusclaude-3-opus-20240229Legacy large
The source of truth is docs.anthropic.com/en/docs/models-overview. Model IDs change with each release — pin the full versioned ID, not a bare alias.

Deprecated → replacement table

Deprecated IDUse instead
claude-2claude-3-5-haiku-20241022
claude-2.1claude-3-5-sonnet-20241022
claude-instant-1claude-haiku-4-5-20251001
claude-instant-1.2claude-haiku-4-5-20251001
claude-3-opus (no date)claude-3-opus-20240229
claude-3-sonnet (no date)claude-3-5-sonnet-20241022
claude-v1claude-sonnet-4-6

Fix in Python

import anthropic

client = anthropic.Anthropic()

# ❌ Deprecated — will throw not_found_error
# model="claude-2"

# ✅ Correct current model IDs
message = client.messages.create(
    model="claude-sonnet-4-6",   # or claude-opus-4-7, claude-haiku-4-5-20251001
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello"}]
)

Fix in TypeScript / Node.js

import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic();

// ❌ Deprecated
// model: "claude-2",

// ✅ Current
const message = await client.messages.create({
  model: "claude-sonnet-4-6",
  max_tokens: 1024,
  messages: [{ role: "user", content: "Hello" }],
});

List available models via API

import anthropic

client = anthropic.Anthropic()

# List all models your key has access to
models = client.models.list()
for model in models.data:
    print(model.id, model.display_name)

Use the /v1/models endpoint to programmatically enumerate valid model IDs for your account tier.

Related errors