October 28, 2026
Claude API Pricing Explained: Cost Breakdown by Model (October 2026)
Claude API pricing in October 2026 runs from $0.10 per million input tokens and $0.50 per million output tokens on Haiku 5.5 up to $10 and $50 on Fable 5.1, with Sonnet 5.5 at $2/$10 and Opus 5.5 at $4/$20. Cache hits on the newest models cost as little as 2.5% of the input rate, and the Batch API halves everything else, so the price you pay depends far more on how you call Claude than on which model you pick.
That last point is where agent budgets leak. In Anthropic's own sample coding session, re-reading cached context made up 51% of the bill while the developer's fresh input was under 1%. This blog gives you every current rate, then shows exactly where agent spend goes and which levers move it.
TL;DR
- Current rates per 1M tokens: Haiku 5.5 $0.10/$0.50 (prompts up to 100K tokens), Sonnet 5.5 $2/$10, Opus 5.5 $4/$20, Fable 5.1 $10/$50.
- Caching got cheaper: cache hits on Opus 5.5 and Sonnet 5.5 bill at 0.05x input ($0.20 and $0.10), half the old 0.1x rate. Fable 5.1 bills at 0.025x.
- The tokenizer moved the goalposts: Claude 4.7 and later models produce about 30% more tokens for the same text, so Opus 5.5's 20% price cut leaves the same text roughly 4% more expensive than it was on Opus 4.6.
- No long-context surcharge: Claude 4.6+ models (except Haiku 5.5) bill a 900K-token request at the same per-token rate as a 9K one.
- Agent bills are context bills: history and tool results are resent on every turn, so caching, routing and context hygiene beat any model swap. Stacked together, they take our illustrative 20-engineer workload from $46,200 to $6,704 a month.
What every Claude model costs on the API right now
Anthropic currently sells four model tiers on the API, and all four share a 1M-token context window and 128K max output. The API IDs are claude-haiku-5-5, claude-sonnet-5-5, claude-opus-5-5 and claude-fable-5-1. The table below lists standard real-time rates on the default global inference route, taken from Anthropic's official pricing page.
| Model | Input | Output | 5-min cache write | 1-hour cache write | Cache hit | Batch input / output |
|---|---|---|---|---|---|---|
| Haiku 5.5 (prompt up to 100K) | $0.10 | $0.50 | $0.125 | $0.20 | $0.01 | $0.05 / $0.25 |
| Haiku 5.5 (prompt over 100K) | $0.50 | $2.50 | $0.625 | $1.00 | $0.05 | $0.25 / $1.25 |
| Sonnet 5.5 | $2 | $10 | $2.50 | $4 | $0.10 | $1 / $5 |
| Opus 5.5 | $4 | $20 | $5 | $8 | $0.20 | $2 / $10 |
| Fable 5.1 | $10 | $50 | $12.50 | $20 | $0.25 | $5 / $25 |

A quick way to read these numbers: one million input tokens plus one million output tokens costs $12 on Sonnet 5.5, $24 on Opus 5.5, and $0.60 on Haiku 5.5. Output is 5x the price of input on every tier, which is why verbose answers and long reasoning traces cost more than long prompts.
The Haiku 5.5 threshold that catches people out
Haiku 5.5 is the only current model priced by prompt length. Any request whose input crosses 100,000 tokens pays the higher tier for the whole request, and cache reads and writes count toward that total.
- Suppose an agent sends a 95K-token prompt and gets 2K tokens back. That request costs about $0.0105.
- Add 25K tokens of retrieved files and the same request costs about $0.065, roughly 6x more for 26% more input.
- If your pipeline hovers near the line, trim retrieval or split the job so each request stays under 100K.
Older models you can still call, and what they cost
Legacy models remain on the API, and several now cost more than their replacements. If any of these are still pinned in your config, moving to the 5.5 generation is the cheapest change you can make this quarter.
| Model | Input | Output | Cache hit | Notes |
|---|---|---|---|---|
| Opus 5, 4.8, 4.7, 4.6, 4.5 | $5 | $25 | $0.50 | Opus 4.7 and later use the newer tokenizer |
| Opus 4.1 and Opus 4 | $15 | $75 | $1.50 | 3.75x Opus 5.5 on both input and output |
| Sonnet 5 | $2 | $10 | $0.20 | Same list price as Sonnet 5.5, double the cache-hit rate |
| Sonnet 4.6, 4.5, 4 | $3 | $15 | $0.30 | Sonnet 4.5 is deprecated |
| Haiku 4.5 | $1 | $5 | $0.10 | 10x Haiku 5.5 for short prompts |
| Haiku 3.5 | $0.80 | $4 | $0.08 | |
| Fable 5 / Mythos 5 | $10 | $50 | $1 | Fable 5.1 cut cache hits to $0.25 |
How Claude API billing works: tokens, thinking and the 30% tokenizer change
You pay for three things on every call: input tokens you send, output tokens Claude writes, and any cache operations. A token is a chunk of text, roughly three to four characters of English, and the token counting endpoint gives exact counts per model before you send anything.
A few billing rules shape real costs more than the headline rates:
- Thinking is output. Extended thinking tokens bill at the output rate, and on Opus 5.5, Sonnet 5.5, Haiku 5.5, and the Fable models, thinking is always on. You control its size with the effort setting, not an off switch.
- The full window costs the same. Claude 4.6 and later models (except Haiku 5.5) include the 1M-token window at standard rates, so there is no long-context premium to plan around.
- Tools add hidden input. Turning on tool use adds 286 system-prompt tokens per request on the 5.5 models. The text_editor tool adds 974 tokens, computer use adds about 4,500 and browser use about 6,600, before any screenshot is billed as image input.
The tokenizer tax most pricing tables miss
Claude 4.7 and later models use a newer tokenizer that produces about 30% more tokens for the same text, according to Anthropic's pricing notes. List prices dropped across the 5.5 generation, but the token count went up underneath them, so a fair comparison has to adjust for both.

Here is what that means in practice:
- Haiku 4.5 to Haiku 5.5: the list price fell 90%, and the same text still costs about 87% less. This is the biggest real price cut in the lineup.
- Sonnet 4.6 to Sonnet 5.5: a 33% list cut becomes about 13% cheaper for the same text.
- Opus 4.6 to Opus 5.5: a 20% list cut becomes about 4% more expensive for the same text. Against Opus 4.7 or Opus 5, which already used the new tokenizer, the 20% cut holds.
The 30% figure is an average. Developer measurements on agent content came in between 1.325x and 1.46x, so the Opus 4.6 to Opus 5.5 change can land anywhere from about 6% to 17% more expensive for the same text. Before migrating a high-volume pipeline, run a sample of your real prompts through the token counter for both model IDs.
How Opus pricing changed from Opus 4 to Opus 5.5
Flagship-tier Claude has become much cheaper in a short time. Opus 4 and 4.1 launched at $15 input and $75 output, Opus 4.5 cut that by two thirds to $5/$25, and Opus 5.5 brought it to $4/$20 while cutting cache hits from $0.50 to $0.20.

Put simply, input on the top coding tier is 73% cheaper than it was on Opus 4.1. The trend tells you two things for planning: per-token prices keep falling, and the work you route to the top tier keeps getting cheaper, so lock in workflows that can move between tiers rather than contracts priced on today's rates.
The add-ons that change your Claude API bill
The base rate is only part of the invoice. These modifiers stack with each other, and several of them are larger than the gap between two model tiers.
Prompt caching: the biggest discount on the page
Caching stores a reusable prefix of your prompt (tool definitions, system prompt, documents, conversation history) so later requests read it instead of reprocessing it. Writes cost a premium, and reads cost a fraction of input.
| Cache operation | Price vs base input | Lifetime |
|---|---|---|
| 5-minute write | 1.25x | 5 minutes, refreshed on each hit |
| 1-hour write | 2x | 1 hour |
| Read on Haiku 5.5 and older models | 0.1x | Same as the write |
| Read on Opus 5.5 and Sonnet 5.5 | 0.05x | Same as the write |
| Read on Fable 5.1 and Mythos 5.1 | 0.025x | Same as the write |
Suppose an agent resends a 50K-token prefix on 20 consecutive Sonnet 5.5 calls. Without caching that is 1M input tokens, or $2.00. With caching, it is one 5-minute write ($0.125) plus 19 reads ($0.095), about $0.22, an 89% cut on the prefix. The Kernel & Chai explainer walks through the same 20-call example in under a minute. The one condition is that the prefix stays byte-identical and the next call arrives before the cache expires. We cover the setup in detail in our prompt caching guide for coding agents.
Batch API, fast mode, data residency and tool fees
- Batch API: 50% off input and output for asynchronous jobs, and it stacks with caching. Use it for evals, test generation, backfills, and nightly code review.
- Fast mode: a research preview on Opus 5.5 at $8/$40 (2x standard) and on Opus 5 and 4.8 at $10/$50. It cannot be combined with Batch.
- US-only inference: setting inference_geo: "us" on Claude 4.6+ models adds 1.1x to every token category. Regional endpoints on Bedrock and Google Cloud carry a similar 10% premium.
- Web search: $10 per 1,000 searches plus the tokens of the results. Web fetch has no fee beyond tokens, so cap it with max_content_tokens.
- Code execution: free when web search or web fetch is in the request; otherwise 1,550 free hours per organization per month, then $0.05 per container-hour with a 5-minute minimum.
- Managed Agents: $0.08 per session-hour while running, on top of tokens. Anthropic's worked example, a one-hour Opus 5.5 session with 50K input and 15K output, costs $0.58, or $0.43 when 40K of the input is cached.
Claude API vs OpenAI vs Gemini pricing in October 2026
Tier for tier, the three big APIs now list almost identical prices. The table compares standard per-1M-token rates from each provider's official page as of October 2026.
| Tier | Anthropic Claude | OpenAI | Google Gemini |
|---|---|---|---|
| Small | Haiku 5.5: $0.10 / $0.50, cached $0.01 | GPT-6 Luna: $0.10 / $0.50, cached $0.01 | Gemini 3.1 Flash-Lite: $0.25 / $1.50, cached $0.025 |
| Mid | Sonnet 5.5: $2 / $10, cached $0.10 | GPT-6.1 Sol: $2 / $10, cached $0.10 | Gemini 3.8 Flash: $0.75 / $3.75 (doubles 1 Jan 2027) |
| Upper | Opus 5.5: $4 / $20, cached $0.20 | No equivalent tier listed | Gemini 4 Argon: $2 / $10 until 30 Nov, then $4 / $20 |
| Flagship | Fable 5.1: $10 / $50, cached $0.25 | GPT-6 Astra: $10 / $50, cached $1.00 | No equivalent tier listed |
Sources: OpenAI API pricing, Gemini API pricing, Anthropic pricing page.
Three conclusions fall out of this table:
- List parity is real at the small and mid tiers. Haiku 5.5 matches Luna and Sonnet 5.5 matches Sol to the cent, including cached input.
- Claude wins on cached flagship reads. Fable 5.1 cache hits cost $0.25 against Astra's $1.00, a 4x gap that compounds in long agent loops.
- Per-token price is a weak proxy for per-task cost. The Register, reporting SemiAnalysis research, cited Artificial Analysis figures of $0.72 per task for GPT-6.1 Sol against $5.98 for Opus 5.5. Those two models sit in different tiers, but the gap shows how much tokens per task, reasoning length and retries swing the final bill.
The practical test is to run 50 of your own tasks through each candidate model and divide total spend by tasks completed. That number, cost per finished task, is the one that should drive the decision.
API or subscription: when Claude Pro or Max beats pay-as-you-go
Claude's consumer plans are priced at $20 a month for Pro ($17 billed annually), $100 for Max 5x and $200 for Max 20x. Team seats run $25 a month (Standard) or $125 (Premium), and Enterprise is $20 a seat plus usage at API rates, according to Claude's pricing page.
For an individual developer, subscriptions are heavily subsidised. The same Register report says SemiAnalysis measured Claude Pro at roughly 2.9 billion tokens a month of capacity, and estimated that subscriptions use about 42% of Anthropic's inference compute while bringing in about 10% of its revenue. Use these rules of thumb:
- Under about $20 a month of API usage: stay on the API. You pay only for what you use.
- Daily interactive coding by one person: a Max plan almost always beats the API. Anthropic reports that Claude Code averages about $13 per developer per active day at API rates, or $150 to $250 a month, with 90% of users under $30 per active day, per its Claude Code cost guide.
- Unattended agents on the API burn money fast. One creator reported that running Opus 4.6 through an always-on agent over the API cost $50 in 30 minutes from a handful of chat messages.
- Products, pipelines and shared agents: you need the API. Subscriptions cover a person using Claude's apps, not software calling the API on behalf of your users.
- Teams of 20+ engineers: model the API with caching and routing first. At that scale the levers below usually cost less than premium seats for everyone.
Where the money goes in an AI coding agent
Coding agents spend most of their budget re-reading context, not answering prompts. Every turn resends the full conversation, and every tool call sends another request carrying the tool results, so a session's cost grows with its length even when your messages stay short.

We priced the sample session in Anthropic's Claude Code cost documentation (1.2K input, 5.3K output, 940K cache-read and 50K cache-write tokens on Sonnet 4.6) at list rates. The result was $0.55, with cache reads at 51%, cache writes at 34%, output at 14%, and the developer's fresh input at under 1%. The same documentation points to the usual causes of runaway sessions:
- Long, never-cleared sessions. A one-line question in a session open all day still pays to re-read the whole history.
- Cache misses after a break. The first message after the cache lifetime lapses reprocesses the full context at write rates.
- Subagents and agent teams. Each one runs its own context window, and agent teams in plan mode use about 7x the tokens of a standard session.
- Opus left as the default. Anthropic names this and uncleared sessions as the two most common causes of unexpectedly high spend.
What developers report from their own Claude bills
Developer forums show the same pattern from the inside, and several posts include numbers worth knowing before you set a budget.
- Most waste came from idle gaps. A Reddit user who audited 926 of their own Claude Code sessions estimated about $1,619 of usage over 33 days, found 54% of turns arrived after a gap longer than 5 minutes (so the cache had expired), and counted 1,122 redundant file reads. Commenters disputed the dollar estimate, but the cache-expiry share is the useful signal.
- The tokenizer hit is bigger on agent content. One developer measured the Claude 4.7 tokenizer at a weighted 1.325x more tokens on real Claude Code content, with CLAUDE.md files at 1.445x, and modeled an 80-turn session rising from $6.65 to between $7.86 and $8.76. Simon Willison measured 1.46x on his own Opus 4.7 vs Opus 4.6 comparison.
- A cache bug can double cost per call. In a Claude Code GitHub issue during a cache invalidation bug, one user's cache hit rate fell from 91% to 75%, and cost per call rose from $0.37 to $0.91.
- Cheaper tokens do not guarantee a cheaper task. A Hacker News commenter pointed to Artificial Analysis data showing Sonnet 5 at $2.29 per task against $1.80 for Opus 4.8, because the smaller model used more tokens to finish.
The Claude Code team at Anthropic treats this as an operations problem.
Thariq Shihipar, who works on Claude Code, wrote that "we alert on cache breaks and treat them as incidents," and noted that switching a long session to Haiku can cost more than staying put, because the new model has to rebuild the cache from scratch (Anthropic blog).

How to cut Claude API costs without losing output quality
The levers below are ordered by how much they save on a typical agent workload. Each one keeps output quality intact because it changes what you pay for repeated or routine work, not the reasoning applied to the hard parts.
1. Cache every stable prefix
Put content that does not change at the front of the request (tool definitions, then the system prompt, then reference documents, then history) and mark the end of the stable block with cache_control. Then check the usage object on each response:
- cache_read_input_tokens should carry most of your input after the first call.
- A large cache_creation_input_tokens on every call means something in the prefix changes each time, often a timestamp, a reordered tool list or a fresh file listing.
- If users pause longer than 5 minutes between turns, the 1-hour write (2x) pays for itself after the first reuse that would otherwise miss.
2. Route each step to the cheapest model that can do it
Most agent steps are reading files, searching, classifying, or formatting, and Haiku 5.5 handles those at 1/40th of Opus 5.5's input price. Keep Sonnet 5.5 for everyday implementation and reserve Opus 5.5 for multi-file changes, hard debugging, and architecture decisions. Our guide to how model routing cuts AI coding costs walks through task classification in more depth.

One catch: caches are per model. Route by lane (one model per kind of step, each with its own stable prefix) rather than bouncing a single conversation between models, or every switch becomes a cache miss.
3. Control output length and reasoning effort
Output costs 5x input, and thinking bills as output. Set the effort level per task (low for renames and formatting, high or max only when the problem calls for it), ask subagents to return a short structured summary instead of paragraphs, and set max_tokens to what the task needs. The Peace Of Code episode on token costs makes the same point: a subagent that returns ten paragraphs instead of one line pays the output rate on every one of them.
4. Batch anything nobody is waiting for
Evals, test generation, documentation passes, dependency audits and nightly reviews can run through the Batch API at half price. Results arrive asynchronously, so keep it out of interactive loops.
5. Shrink the context you send
- Keep project instruction files short. Anthropic recommends keeping CLAUDE.md under 200 lines and moving workflow-specific instructions into on-demand skills.
- Filter tool output before it reaches the model. A hook that greps a 10,000-line log for ERROR cuts tens of thousands of tokens to a few hundred.
- Prefer CLI tools like gh over MCP servers when both exist, disable MCP servers you are not using, and clear the session between unrelated tasks.
What the levers add up to on a real workload
To size the effect, we modeled a 20-engineer team running a coding agent: 300 agent requests per engineer per day over 22 working days, or 132,000 requests a month. Each request carries an 80K-token context, of which 70K is a reusable prefix, and returns 1.5K output tokens. We assumed a 90% cache hit rate.

- All Opus 5.5, no caching: $46,200 a month.
- Cache the stable prefix: $15,523, a 66% drop and by far the largest single lever.
- Route 20% of steps to Opus 5.5, 60% to Sonnet 5.5, and 20% to Haiku 5.5: $7,848, another 49% off.
- Lower effort on routine steps (30% less output): $7,248.
- Move the 15% of requests that are nightly jobs to Batch: $6,704, about 7x cheaper than where we started.
Your mix will differ, but the order rarely does. Caching first, routing second, then output and batching as cleanup.
How real teams cut Claude and LLM costs, step by step
Published case studies with exact steps are rare, so we kept only the ones that state what was done and what it saved.
Smartsheet: 60% lower operating cost by caching code context
Smartsheet rolled out an AI coding assistant on Amazon Bedrock with Claude and worked on its caching layer, as described on the AWS Architecture Blog.
- They contributed a prompt caching system to the open-source coding tool their engineers used.
- They checked model support and the minimum token threshold before enabling caching on a request.
- They cached checkpoints for static system instructions and code context, using a 5-minute lifetime that refreshed on every hit.
- Follow-up queries then read the cached prefix instead of reprocessing it.
The result was 60% lower operating cost and 20% better latency. Follow-up queries were served 90% from cache at 83% lower cost, and 70% of all input tokens came from cache.
Care Access: 86% lower processing cost with a record-as-prefix design
Care Access processes 300 to 500+ health records a day and asks many questions of each one. Per the AWS Machine Learning Blog, they made each normalized record the cached prefix, kept the questions as the changing suffix, and merged the answers into JSON for analytics. Bedrock costs fell 86%, and processing got 66% faster. The post does not name the model, but the design applies directly to Claude: one large stable document, many short questions.
Anthropic's own optimization runs: cost down, accuracy held or improved
Anthropic published results from tuning its own agent workloads on the Claude Platform blog. These are vendor benchmarks, so treat them as a direction rather than a promise.
- Migrating a workload from Opus 4.8 to Opus 5.5 cut cost by about 18%, and a prompt audit cut a further 9%.
- An automated cost-optimization pass cut cost on the tau2-bench retail benchmark by about 73% with no change in pass rate.
- A customer-support agent running Sonnet 5 at low effort, with an improved prompt, reached 90.5% held-out accuracy against 78.6% for the baseline, at about one fifth of the cost.
What usually works: the pattern across these cases
Read side by side, the forum data, case studies, and our own model point to the same few rules:
- Caching delivers the largest cut, from 53% on multi-turn chat to 90% on long-document prompts in Anthropic's published tests, but it fails quietly. Watch your cache hit rate the way you watch error rates.
- Idle time is the silent cost. When people pause longer than the cache lifetime, the next turn pays full write price. Use the 1-hour cache for human-in-the-loop work.
- Measure cost per finished task. Per-token price misled teams in both directions in the examples above.
- Route by lane, not by message. Fixed models per step type keep caches warm; switching one conversation between models throws them away.
- Lower effort on a well-prompted model often beats higher effort on a vague prompt, on both cost and accuracy.
How ML.ai cuts the cost of every finished coding task
Everything above is work your team has to build and maintain: cache-friendly prompt layouts, a routing policy, effort settings, context limits and cost monitoring. ML.ai is a coding agent that ships those decisions built in, so engineers hand it a bug fix, a test suite or a multi-week migration and get a reviewed pull request back without managing tokens.
Here is how ML.ai maps to the levers in this guide:
- Automatic model routing per step. ML.ai sends each step of a task to the model suited to it, so file reads and searches do not run on the most expensive model. You set effort and constraints instead of picking vendors.
- Effort you choose per message. Five reasoning levels, from low to max, let you spend deep reasoning only where a task needs it.
- Read-only exploration and planning. Explore and Plan agents investigate and write a plan without edit tools, so you approve the approach before any expensive implementation run starts.
- Context kept in check. A context meter warns at 65% and 85% of the window, and attachments are bounded at 50 KB and 2,000 lines when sent to the model, with truncation clearly marked.
- Fewer retry loops. After each edit, ML.ai pulls your editor's own language diagnostics into the conversation, so the agent sees a type error immediately instead of burning extra turns rerunning builds.
- Diffs before anything lands. Every change shows as a diff you approve, and shell commands pass a safety check before they run.
ML.ai runs as a desktop and web app, in VS Code and JetBrains, and as a CLI, with parallel jobs in isolated sandboxes. Pricing is flat, with no token counter or credit balance to watch. Team plans start at $29 per seat per month (billed annually, five-seat minimum), and Enterprise adds self-hosted or VPC deployment, bring-your-own model endpoints and data residency. See ML.ai pricing or read about ML.ai for enterprise engineering teams.
Try ML.ai on your next migration or bug backlog and compare the cost per merged pull request against your current API bill.
Frequently Asked Questions
How much does the Claude API cost per million tokens?
In October 2026, Haiku 5.5 costs $0.10 input and $0.50 output per million tokens for prompts up to 100K tokens, Sonnet 5.5 costs $2/$10, Opus 5.5 costs $4/$20 and Fable 5.1 costs $10/$50. Batch requests are half price, and cache hits cost between 2.5% and 10% of the input rate depending on the model.
Is the Claude API free?
No. New accounts receive a small amount of free credit for testing, after which usage is billed monthly in USD by card or invoice. Claude's Free plan covers the chat apps, not API access.
Does a Claude Pro or Max subscription include API access?
No. Subscriptions cover use of Claude's own apps, including Claude Code when signed in with the subscription. Applications that call the API need an API key billed per token through the Claude Console.
Why is my Claude API bill higher after upgrading to a newer model?
Claude 4.7 and later models use a tokenizer that produces about 30% more tokens for the same text. Moving from Opus 4.6 ($5 input) to Opus 5.5 ($4 input) can leave text-heavy workloads about 4% more expensive despite the lower list price, so measure token counts on your own prompts before switching.
Is Claude cheaper than OpenAI's API?
At list price the small and mid tiers are identical: Haiku 5.5 and GPT-6 Luna both cost $0.10/$0.50, and Sonnet 5.5 and GPT-6.1 Sol both cost $2/$10. Claude's flagship cache reads are cheaper ($0.25 vs $1.00), but tokens used per task differ by model, so compare cost per completed task on your own workload.
How do I reduce Claude API costs for a coding agent?
Cache stable prefixes, route routine steps to Haiku 5.5 or Sonnet 5.5, lower the effort level on simple tasks, batch anything non-interactive and keep context small. In our illustrative 20-engineer model, those changes cut monthly spend from $46,200 to $6,704.







