Anthropic API Pricing by Model (November 2026)
Claude API pricing in November 2026, per million tokens (MTok), starts with Claude Fable 5.1 at $10 input and $50 output. Opus 5.5 costs $4 / $20, Sonnet 5.5 costs $2 / $10, and Haiku 5.5 costs $0.10 / $0.50 for prompts up to 100K tokens and $0.50 / $2.50 above that. Per single token, Sonnet 5.5 is $0.000002 input and $0.00001 output. The Batch API halves every rate. Cache hits cost $0.25 on Fable 5.1, $0.20 on Opus 5.5, $0.10 on Sonnet 5.5, and $0.01 on Haiku 5.5. Opus 5.5 fast mode is $8 / $40. US-only inference through inference_geo adds a 1.1x multiplier on Claude 4.6 and later models. Claude 4.7 and later models use a tokenizer that produces about 30% more tokens for the same text. Older models stay billable at their launch prices, listed below. Prices verified against Anthropic's pricing docs on November 1, 2026.
| Model | Input (per MTok) | Output (per MTok) | Cache hit (per MTok) |
|---|---|---|---|
| Claude Fable 5.1 | $10.00 | $50.00 | $0.25 |
| Claude Opus 5.5 | $4.00 | $20.00 | $0.20 |
| Claude Sonnet 5.5 | $2.00 | $10.00 | $0.10 |
| Claude Haiku 5.5 (prompt up to 100K) | $0.10 | $0.50 | $0.01 |
| Claude Haiku 5.5 (prompt over 100K) | $0.50 | $2.50 | $0.05 |
| Claude Opus 5, 4.8, 4.7, 4.6, 4.5 | $5.00 | $25.00 | $0.50 |
| Claude Sonnet 5 | $2.00 | $10.00 | $0.20 |
| Claude Sonnet 4.6, 4.5, 4 | $3.00 | $15.00 | $0.30 |
| Claude Haiku 4.5 | $1.00 | $5.00 | $0.10 |
| Claude Opus 4.1, Opus 4 | $15.00 | $75.00 | $1.50 |
| Claude Haiku 3.5 | $0.80 | $4.00 | $0.08 |
Opus 5.5 at $4/$20 undercuts the $5/$25 that Opus 4.5 through Opus 5 still charge, and Opus 4.1 cost $15/$75. Haiku 5.5 at $0.10/$0.50 is a tenth of Haiku 4.5's $1/$5 for prompts up to 100K tokens. The newer tokenizer on Claude 4.7 and later produces about 30% more tokens for the same text, so per-task savings are smaller than the per-token gap.
Opus 5.5 fast mode costs $8/$40 per MTok, twice the standard rate. Fast mode on Opus 5 and Opus 4.8 is in research preview at $10/$50. Fast mode is not available with the Batch API, and caching and data-residency multipliers apply on top of it. For most coding agent workloads, standard Opus 5.5 or Sonnet 5.5 gives better cost per task.
Why Coding Agents Cost More Than Chat
A chatbot sends a message, gets a response, and moves on. A coding agent reads files, calls tools, handles errors, retries, reads more files, and accumulates context across dozens of turns. The token consumption profile is fundamentally different.
Context Accumulation
Every file read, tool output, and error trace gets appended to the conversation. A 30-turn agent session on a medium codebase easily hits 200K-500K input tokens. At Opus 5.5 rates, 500K input tokens costs $2.00 per session before any output.
Search Overhead
Cognition measured that 60% of coding agent compute goes to search and context retrieval, not code generation. The agent reads 10 files to edit 1. You pay input token rates for all 10 files, but only the edit generates value.
Error Recovery Loops
When a coding agent generates code that fails a test, it re-reads the error output, the failing test, the original file, and tries again. Each retry resends the full conversation history. Three retries on a 100K-token context adds 300K tokens of pure overhead.
Extended Thinking Overhead
Extended thinking tokens are billed as output tokens. A complex reasoning step might generate 2,000-5,000 thinking tokens before producing 500 tokens of visible output. At Opus 5.5 output rates ($20/MTok), thinking on complex problems can 3-5x your output cost.
Anthropic's Claude Code cost docs put the enterprise average at about $13 per developer per active day and $150-250 per developer per month, with 90% of users under $30 per active day. Developers running autonomous agents on large codebases sit at the top of that range, because a 30-turn session at 300K tokens per turn costs ten times more than a 30-turn session at 30K tokens per turn.
Batch API: 50% Off Everything
The Batch API processes requests asynchronously within a 24-hour window and charges half price on both input and output tokens. Every Claude model is eligible. No code changes beyond switching to the batch endpoint.
| Model | Standard Input | Batch Input | Standard Output | Batch Output |
|---|---|---|---|---|
| Fable 5.1 | $10.00 | $5.00 | $50.00 | $25.00 |
| Opus 5.5 | $4.00 | $2.00 | $20.00 | $10.00 |
| Sonnet 5.5 | $2.00 | $1.00 | $10.00 | $5.00 |
| Haiku 5.5 (up to 100K) | $0.10 | $0.05 | $0.50 | $0.25 |
For coding agents, batch processing works for non-interactive tasks: code review across a repository, bulk test generation, documentation generation, or offline analysis. You cannot use batch for interactive agent sessions where the developer is waiting for results.
The batch discount stacks with prompt caching. A batch request with a cache hit on Opus 5.5 costs $0.10 per MTok input, down from $4.00 standard. That is a 97.5% reduction.
Prompt Caching: 90% Off Repeated Context
Prompt caching is the single most impactful cost lever for coding agents. System prompts, file contents, and conversation history that repeat across requests get cached. Subsequent cache hits cost 10% of the standard input price.
| Operation | Price Multiplier | Duration | Break-even |
|---|---|---|---|
| 5-minute cache write | 1.25x base input | 5 minutes | 1 cache hit |
| 1-hour cache write | 2x base input | 1 hour | 2 cache hits |
| Cache hit (read) | 0.1x base input | Same as write | Immediate savings |
Concrete numbers: a coding agent with a 50,000-token system prompt (instructions, repository map, coding conventions) on Sonnet 5.5. Standard cost per request for that prompt is $0.10. With 5-minute caching, the first request pays $0.125 for the cache write and each hit after that pays $0.005. Over 100 requests in one session, the system prompt cost drops from $10.00 to $0.62.
| Model | Standard Input | Cache Hit | Savings |
|---|---|---|---|
| Fable 5.1 | $10.00 | $0.25 | 97.5% |
| Opus 5.5 | $4.00 | $0.20 | 95% |
| Sonnet 5.5 | $2.00 | $0.10 | 95% |
| Haiku 5.5 (up to 100K) | $0.10 | $0.01 | 90% |
Add a single cache_control field at the top level of your API request and Anthropic manages cache breakpoints automatically as conversations grow. For fine-grained control, place cache_control on individual content blocks.
Extended Thinking Token Costs
Extended thinking lets Claude reason step-by-step before producing a response. The thinking tokens are billed as output tokens at the same rate as visible output. There is no separate pricing tier for thinking.
| Scenario | Visible Output | Thinking Tokens | Total Output Cost (Opus 5.5) |
|---|---|---|---|
| Simple code edit | 500 tokens | 0 | $0.01 |
| Complex refactor | 500 tokens | 2,000 tokens | $0.05 |
| Multi-file architecture | 1,000 tokens | 5,000 tokens | $0.12 |
| Debugging with reasoning | 800 tokens | 4,000 tokens | $0.096 |
For coding agents, extended thinking is valuable on complex problems but expensive on routine ones. The thinking budget is configurable (minimum 1,024 tokens). Setting an appropriate budget per task type prevents runaway thinking costs. Simple file edits do not need 5,000 tokens of reasoning. Architecture decisions do.
Reducing Context Size with Compaction
Prompt caching reduces the cost of repeated context. Compaction reduces the size of context itself. Different problem, complementary solution.
As a coding agent runs, its context window fills with file contents, tool outputs, error traces, and prior conversation turns. Much of this is redundant or no longer relevant. A file read from turn 3 that was edited in turn 15 is stale. An error trace from a failed attempt that was since fixed is noise.
Extractive compaction keeps only the lines that still matter and discards the rest, so every surviving line is character-for-character from the original input. Nothing is paraphrased, hallucinated, or synthesized. Compared to summarization, the extractive approach carries no risk of inventing details that were never in the context.
The cost math: a coding agent session with 400K tokens of accumulated context, running on Sonnet 5.5. Without compaction, every subsequent turn sends 400K input tokens at $2/MTok = $0.80 per turn. After compaction to 160K tokens, each turn costs $0.32. Over a 20-turn continuation, that saves $9.60 in input costs alone.
| Metric | No Compaction | With Compaction | Savings |
|---|---|---|---|
| Context size (after 30 turns) | 400K tokens | 160K tokens | 60% |
| Input cost per turn (Sonnet 5.5) | $0.80 | $0.32 | $0.48/turn |
| 20-turn continuation cost | $16.00 | $6.40 | $9.60 |
| Effective input cost (Sonnet 5.5) | $0.80/turn | $0.32/turn | 60% lower per turn |
Compaction and prompt caching attack different parts of the bill. Caching reduces the per-token price of repeated context. Compaction reduces the number of tokens you send in the first place. A 400K context compacted to 160K, with the remaining tokens served from cache at 0.1x rates, brings effective input cost down by 96%.
Anthropic vs OpenAI Pricing for Coding Agents
OpenAI's current GPT per-token rates live on our OpenAI API pricing page. Per-task cost depends on how many tokens each model needs, how much of the prompt is cached, and whether the job can wait for batch.
| Factor | Claude Sonnet 5.5 | Claude Opus 5.5 | Claude Haiku 5.5 |
|---|---|---|---|
| Input price (per MTok) | $2.00 | $4.00 | $0.10 (up to 100K) |
| Output price (per MTok) | $10.00 | $20.00 | $0.50 (up to 100K) |
| Batch discount | 50% | 50% | 50% |
| Cache hit price | 5% of input | 5% of input | 10% of input |
| Long prompts | 1M context at standard rates | 1M context at standard rates | Higher rate over 100K |
| Fast mode | No | $8 / $40 | No |
Two Claude mechanics shift per-task cost for coding agents. Cache hits on Opus 5.5 and Sonnet 5.5 cost 5% of the input price, and Fable 5.1 hits cost 2.5%, so agents that resend the same repository context pay a fraction of list price. Claude 4.6 and later models, except Haiku 5.5, bill a 900K-token request at the same per-token rate as a 9K-token request.
For simple tasks like test generation, docstrings, and formatting, Haiku 5.5 at $0.10/$0.50 is the cheapest Claude option. A tiered setup sends hard reasoning to Opus 5.5 or Sonnet 5.5 and routine tasks to Haiku 5.5, which gives the best cost profile.
Cost Optimization Playbook
Four techniques stack to cut Anthropic API costs for coding agents. Each one is independent; combining all four gives the maximum reduction.
1. Right-size Your Model
Use Haiku 5.5 ($0.10/$0.50) for classification, linting, and simple edits. Use Sonnet 5.5 ($2/$10) for code generation and multi-step reasoning. Reserve Opus 5.5 ($4/$20) or Fable 5.1 ($10/$50) for architecture decisions and the hardest debugging. Route each request to the cheapest tier automatically based on task complexity.
2. Enable Prompt Caching
System prompts, repository maps, and coding conventions repeat on every request. Caching these at 10% of input price saves 85-90% on the static portion of your context. Break-even is one cache hit for 5-minute caching. If your agent makes more than one request per 5 minutes (it does), caching pays for itself immediately.
3. Compact Context Between Turns
After 20-30 turns, agent context is 60-80% stale information: superseded file reads, resolved errors, abandoned approaches. Extractive compaction shrinks context by 50-70%, keeping only relevant lines. Fewer tokens sent = lower cost, proportionally.
4. Batch Non-Interactive Work
Code review, test generation, documentation, and bulk analysis do not require real-time responses. Route these through the Batch API for a flat 50% discount. The 24-hour processing window is fine for CI/CD pipeline tasks that run overnight.
| Configuration | Price per MTok | Savings vs Standard |
|---|---|---|
| Standard | $2.00 | 0% |
| + Prompt caching (hit) | $0.10 | 95% |
| + Context compaction (60%) | $0.04 effective | 98% |
| + Batch processing | $0.02 effective | 99% |
The compaction row works differently from the others. Caching and batch reduce the per-token price. Compaction reduces the number of tokens. If you compact 300K tokens to 120K tokens, you send 120K tokens at whatever per-token rate applies. The $0.12 effective rate reflects sending 120K tokens at the $0.30 cache-hit rate, divided by the original 300K to get an effective per-MTok cost on the original context.
Frequently Asked Questions
How much does the Anthropic API cost?
As of November 2026, Claude Fable 5.1 costs $10 input / $50 output per million tokens. Opus 5.5 costs $4 / $20, Sonnet 5.5 costs $2 / $10, and Haiku 5.5 costs $0.10 / $0.50 for prompts up to 100K tokens ($0.50 / $2.50 above that). The Batch API takes 50% off. Cache hits cost 2.5% to 10% of the input price depending on the model, and these discounts stack.
How much does a Claude coding agent cost per day?
Anthropic's Claude Code cost docs put the enterprise average at about $13 per developer per active day and $150-250 per developer per month, with 90% of users under $30 per active day. The main variable is context length per turn, and prompt caching plus compaction cut it the most.
What is the Batch API discount?
The Batch API takes 50% off input and output tokens on every Claude model. Opus 5.5 drops from $4/$20 to $2/$10 per million tokens, Sonnet 5.5 from $2/$10 to $1/$5, and Haiku 5.5 from $0.10/$0.50 to $0.05/$0.25. The batch discount stacks with prompt caching.
How does prompt caching work?
You mark portions of your prompt for caching. The first request pays a write premium (1.25x for 5-minute cache, 2x for 1-hour cache). Subsequent requests within the cache window read from cache at 10% of the standard input price. For coding agents, system prompts and file contexts are natural candidates. Break-even is one cache hit on 5-minute caching.
Is Claude cheaper than OpenAI for coding?
OpenAI's current per-token GPT rates are on our OpenAI API pricing page. On the Claude side, Sonnet 5.5 is $2/$10 and Opus 5.5 is $4/$20, and cache hits on both cost 5% of the input price. For agents that resend large repository context, cache depth moves per-task cost as much as list price.
What are Anthropic's rate limit tiers?
Anthropic sets rate limits by usage tier, and limits rise as an account's spend grows; the current per-tier numbers are on Anthropic's rate limits page. Pricing does not change by tier. Claude 4.6 and later models, except Haiku 5.5, bill the full 1M context window at standard rates.
How does extended thinking affect cost?
Thinking tokens are billed as output tokens. On Opus 5.5 ($20 per million output tokens), a response with 2,000 thinking tokens and 500 visible tokens costs $0.05 in output, versus $0.01 without thinking. The usage.output_tokens_details.thinking_tokens field reports how many billed output tokens were reasoning.
How does context compaction reduce Claude API costs?
Compaction compresses agent context by 50-70% before sending it to Claude. Fewer input tokens = lower cost, proportionally. A 400K context compacted to 160K saves 60% on input costs every turn. An extractive approach keeps every surviving line verbatim from the original, so it carries no hallucination risk. See how compaction works.
