When you’re building on Claude via the API, you need the exact model string — not just the name. Anthropic uses specific model identifiers that change with each version, and using a deprecated string will break your application. This is the complete reference for Claude API model names, IDs, and specs as of April 2026.
claude-opus-4-6, claude-sonnet-4-6, and claude-haiku-4-5-20251001. Always use versioned model strings in production — never rely on alias strings that may point to different models over time.
Current Claude API Model Strings (April 2026)
| Model | API Model String | Context Window | Best for |
|---|---|---|---|
| Claude Opus 4.6 | claude-opus-4-6 | 1M tokens | Complex reasoning, highest quality |
| Claude Sonnet 4.6 | claude-sonnet-4-6 | 1M tokens | Production workloads, balanced cost/quality |
| Claude Haiku 4.5 | claude-haiku-4-5-20251001 | 200K tokens | High-volume, latency-sensitive tasks |
Anthropic publishes the full, current list of model strings in their official models documentation. Always verify there before updating production systems — model strings are updated with each new release.
How to Use Model Strings in an API Call
import anthropic
client = anthropic.Anthropic()
message = client.messages.create(
model="claude-sonnet-4-6", # ← model string goes here
max_tokens=1024,
messages=[
{"role": "user", "content": "Your prompt here"}
]
)
print(message.content)
Model Selection: Which String to Use When
The right model depends on your task requirements. Here’s the practical routing logic:
Use Haiku (claude-haiku-4-5-20251001) when: you need speed and low cost at scale — classification, extraction, routing, metadata, high-volume pipelines where every call matters to your budget.
Use Sonnet (claude-sonnet-4-6) when: you need solid quality across a wide range of tasks — content generation, analysis, coding, summarization. This is the right default for most production applications.
Use Opus (claude-opus-4-6) when: the task genuinely requires maximum reasoning capability — complex multi-step logic, nuanced judgment, or work where output quality is the only variable that matters and cost is secondary.
API Pricing by Model
| Model | Input (per M tokens) | Output (per M tokens) |
|---|---|---|
| Claude Haiku | ~$1.00 | ~$5.00 |
| Claude Sonnet | ~$3.00 | ~$5.00 |
| Claude Opus | ~$5.00 | ~$25.00 |
The Batch API offers roughly 50% off all rates for asynchronous workloads. For a full pricing breakdown, see Anthropic API Pricing: Every Model and Mode Explained.
Important: Versioned Strings vs. Aliases
Anthropic occasionally provides alias strings (like claude-sonnet-latest) that point to the current version of a model family. These are convenient for development but can create problems in production — when Anthropic updates the model the alias points to, your application silently starts using a different model without a code change. For production systems, always pin to a versioned model string and upgrade intentionally.
Frequently Asked Questions
What is the Claude API model string for Sonnet?
The current Claude Sonnet model string is claude-sonnet-4-6. Always verify the current string in Anthropic’s official models documentation before deploying, as strings are updated with each new model release.
How do I specify which Claude model to use in the API?
Pass the model string in the model parameter of your API call. For example: model="claude-sonnet-4-6". The model string must match exactly — Anthropic’s API will return an error if the string is invalid or deprecated.
What Claude API model should I use for production?
Claude Sonnet is the right default for most production workloads — it balances quality and cost well across a wide range of tasks. Use Haiku when speed and cost are the priority at scale. Use Opus when the task genuinely requires maximum reasoning capability and cost is secondary.
Leave a Reply