Last refreshed: May 15, 2026
Model Accuracy Note — Updated May 2026
Current flagship: Claude Opus 4.7 (claude-opus-4-7). Current models: Opus 4.7 · Sonnet 4.6 · Haiku 4.5. Claude Opus 4.7 (claude-opus-4-7) is the current flagship as of April 16, 2026. Where this article references Opus 4.6 or earlier models, those references are historical. See current model tracker →. See current model tracker →
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-7, 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.7 | claude-opus-4-7 | 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-7) 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 4.5 | ~$1.00 | ~$5.00 |
| Claude Sonnet 4.6 | ~$3.00 | ~$5.00 |
| Claude Opus 4.7 | ~$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 4.6 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 4.6 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.
📎 Book for Bots — Free
Take this article on steroids.
The Claude Implementation Playbook is a dense 9-section PDF you can attach directly to any AI conversation — pricing tables, model API strings, routing logic, context engineering rules. Verified May 2026.
Claude Reference Hub
Everything you need to use Claude — pricing, models, API setup, and release history.
🔌 Claude API Model IDs & Strings
📡 Current Claude Model Version Tracker
⚙️ How to Install Claude Code
🔑 Anthropic Console & API Keys
📅 Claude 4 Release & Deprecation Guide
📜 Claude Release History: Every Model
📈 Anthropic IPO: Timeline & Valuation
🗂 View Full Claude Reference Hub →

Leave a Reply