model_not_found
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)
| Model | ID | Use case |
|---|---|---|
| Claude Opus 4.7 | claude-opus-4-7 | Most capable |
| Claude Sonnet 4.6 | claude-sonnet-4-6 | Balanced (default) |
| Claude Haiku 4.5 | claude-haiku-4-5-20251001 | Fastest / cheapest |
| Claude 3.7 Sonnet | claude-3-7-sonnet-20250219 | Extended thinking |
| Claude 3.5 Sonnet | claude-3-5-sonnet-20241022 | Strong baseline |
| Claude 3.5 Haiku | claude-3-5-haiku-20241022 | Fast + cheap |
| Claude 3 Opus | claude-3-opus-20240229 | Legacy 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 ID | Use instead |
|---|---|
claude-2 | claude-3-5-haiku-20241022 |
claude-2.1 | claude-3-5-sonnet-20241022 |
claude-instant-1 | claude-haiku-4-5-20251001 |
claude-instant-1.2 | claude-haiku-4-5-20251001 |
claude-3-opus (no date) | claude-3-opus-20240229 |
claude-3-sonnet (no date) | claude-3-5-sonnet-20241022 |
claude-v1 | claude-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
- not_found_error (404) — general resource not found
- invalid_request_error (400) — malformed request body
- permission_error (403) — key doesn't have model access