
Key takeaways
- Claude Code is included with every paid Claude plan: Pro at $20 a month ($17 billed annually), Max at $100 and Ultra at $200. The free plan does not include it.
- On the API, Claude Code is billed per token. Sonnet 5.5 is $2 input and $10 output per million tokens; Opus 5.5 is $4 and $20.
- Anthropic reports an average of about $13 per developer per active day on API billing, and $150 to $250 per developer per month across enterprise deployments.
- Prompt caching is what makes agentic coding affordable. In our worked example it cuts an Opus 5.5 session from about $10.80 to about $2.64.
- Light users are usually cheaper on Pro. Developers who use Claude Code most of the working day usually come out ahead on Max or Ultra rather than raw API billing.
Claude Code is Anthropic's coding agent. It reads your repository, edits files, runs commands and tests, and works from the terminal, an IDE, the desktop app or the web. Because it re-reads large parts of your codebase on every step, it consumes far more tokens than a normal chat conversation. That is why the question of what it costs comes up so often, and why the answer is rarely a single number.
There are two ways to pay. You can use a Claude subscription, which gives you a usage allowance for a flat monthly fee, or you can connect an API key and pay for every token at list price. Teams can also bill through Amazon Bedrock or Google Cloud, which follow the same per token logic on a cloud invoice. Below we cover each route, then work through realistic sessions so you can see where the break-even point sits.
Claude Code subscription plans
Every paid consumer plan includes Claude Code. The allowance resets every five hours and also has a weekly cap, and it is shared with claude.ai and Claude Desktop, so heavy chat use reduces what is left for coding.
| Plan | Monthly price | Usage allowance | Extras relevant to developers |
|---|---|---|---|
| Free | $0 | Limited | Does not include Claude Code |
| Pro | $20, or $17 a month billed annually | Baseline allowance every 5 hours and every week | Claude Code, Projects, more models |
| Max | $100 | 5x Pro usage | $100 a month in API credits, priority access at busy times |
| Ultra | $200 | 10x Pro weekly usage, no 5-hour limit for verified accounts | $200 a month in API credits |
Two details matter for cost planning. First, Anthropic renamed its old Max 5x and Max 20x tiers to Max and Ultra at the end of October 2026 at the same prices, so older articles that mention "Max 20x" are describing what is now Ultra. Second, the API credits bundled with Max and Ultra can be spent on the Claude Platform, which makes those plans more useful if you also run scripts or small internal tools against the API.
Claude Code API pricing per token
When Claude Code runs on an API key it charges by tokens, using the same rates as any other API call. The model you pick has the largest effect on the bill, followed by how much of each request is served from the prompt cache.
| Model | Input | 5 minute cache write | Cache hit | Output |
|---|---|---|---|---|
| Claude Sonnet 5.5 | $2 | $2.50 | $0.10 | $10 |
| Claude Opus 5.5 | $4 | $5 | $0.20 | $20 |
| Claude Fable 5.2 | $8 | $10 | $0.20 | $40 |
Cache hits cost 5% of the normal input rate on Sonnet 5.5 and Opus 5.5. In an agent loop, most of each request is the same system prompt, tool definitions and file contents the agent has already read, so a well cached session pays the cheap rate on the bulk of its input. You can check current rates for every model we track on the AI pricing database and run your own numbers in the Claude cost calculator.
What a real coding session costs
To make this concrete, take a typical task such as fixing a bug and adding tests in a medium sized repository. Assume 40 agent turns. Each turn sends about 60,000 tokens of context, of which 55,000 are already cached and 5,000 are new (written to the cache), and the model returns about 1,500 tokens of edits and reasoning. These are our assumptions, not Anthropic figures, but they match the shape of sessions we see in practice.
| Setup | Cost per turn | Cost per session |
|---|---|---|
| Sonnet 5.5 with caching | $0.033 | about $1.32 |
| Opus 5.5 with caching | $0.066 | about $2.64 |
| Opus 5.5 with no cache hits | $0.270 | about $10.80 |
Here is the Opus 5.5 cached turn in full: 55,000 cache hit tokens at $0.20 per million is $0.011, 5,000 cache write tokens at $5 per million is $0.025, and 1,500 output tokens at $20 per million is $0.030, for $0.066 per turn. Without caching, the same 60,000 input tokens at $4 per million cost $0.24 before output. The model did the same work; the cache alone changed the bill by about four times.
Real days vary much more than one task. Anthropic's own figure across enterprise deployments is about $13 per developer per active day, with 90% of users below $30 per active day. Long sessions, large files, several agents running at once and heavy extended thinking all push the number up.
Subscription or API, which is cheaper
The simplest way to decide is to estimate your monthly API spend and compare it with the plan price. Using the averages above, the picture looks like this:
| Usage pattern | Estimated API spend | Likely better choice |
|---|---|---|
| A few Sonnet sessions a week (about 12 a month) | about $16 | API or Pro, roughly equal |
| Daily use, short sessions (about 20 days at $5) | about $100 | Pro if it fits the limits, otherwise Max |
| Most of the working day (20 days at $13) | about $260 | Max or Ultra |
| Heavy agent use, parallel sessions (20 days at $30) | about $600 | Ultra, or API with team budgets |
Subscriptions win on predictability: the price is fixed and you never get a surprise invoice, but you can hit a usage limit mid task. The API wins on flexibility: there is no cap, you pay only for what you use and it suits automation and CI jobs, but costs rise directly with every extra turn. Many teams mix the two, giving developers plan seats for interactive work and using API keys for scheduled or headless jobs.
Watch for the API key trap
If the `ANTHROPIC_API_KEY` environment variable is set on your machine, Claude Code can bill that key instead of your subscription once you approve it, and it always uses the key in non-interactive `-p` mode. Developers on a paid plan sometimes find a separate API bill because a key was left in their shell profile. Run `/usage` inside Claude Code to confirm which billing path a session is using.
Pros and cons of each option
Subscription plans
- Pro: fixed monthly cost that is easy to budget and approve.
- Pro: Max and Ultra include API credits, so some scripting is effectively prepaid.
- Con: five hour and weekly limits can interrupt long tasks.
- Con: allowance is shared with chat, so it is harder to measure coding usage alone.
API billing
- Pro: no usage cap and full control over the model per task.
- Pro: works for CI, scheduled jobs and shared tools, with spend limits set by an administrator.
- Con: a long or poorly cached session can cost several times more than expected.
- Con: costs are hard to predict until you have a few weeks of usage data.
How to reduce Claude Code costs
- 01Use Sonnet 5.5 for routine edits and switch to Opus 5.5 only for hard debugging or design work. On list price that halves the token cost of most turns.
- 02Clear or compact context between unrelated tasks. Carrying a long history into a new task means paying to re-read it on every turn.
- 03Keep sessions focused. Point the agent at the relevant folder instead of the whole repository.
- 04Limit parallel agents and subagents to tasks that truly benefit from them, since each one reads its own context.
- 05Turn extended thinking down for simple changes. Thinking tokens are billed as output, the most expensive meter.
- 06Track spend with `/usage` and, for teams, set organisation spend limits before a wide rollout, starting with a small pilot group to get a baseline.
If you are comparing Claude Code with other coding models on cost alone, the cheapest LLM API finder ranks every model we track by monthly spend for your own input and output mix. Cost is only one factor, though. A cheaper model that needs more turns or more human fixes can end up costing more per finished task.
Bottom line
For an occasional user, Pro at $20 is the cheapest way to use Claude Code. For a developer who uses it most of the day, the API typically costs $150 to $250 a month or more, which makes Max or Ultra the better value as long as the limits fit. Whichever route you choose, model selection and prompt caching have a bigger effect on cost than the plan itself, so measure a week of real usage before committing a whole team.
Frequently asked questions
- Is Claude Code free?
- No. The free Claude plan does not include Claude Code. The cheapest option is Pro at $20 a month, or $17 a month billed annually, or you can pay per token with an API key.
- How much does Claude Code cost per month on the API?
- It depends on usage. Anthropic reports about $13 per developer per active day on average and $150 to $250 per developer per month across enterprise deployments.
- What is the difference between Claude Max and Ultra?
- Max costs $100 a month with five times Pro usage and $100 in API credits. Ultra costs $200 with ten times Pro weekly usage, no five hour limit for verified accounts and $200 in API credits.
- Why did I get an API bill while on a subscription?
- If ANTHROPIC_API_KEY is set, Claude Code can bill that key instead of your plan once approved, and it always uses it in -p mode. Remove the key or check /usage to see the billing path.
- Which model is cheapest for Claude Code?
- Among current models, Sonnet 5.5 at $2 input and $10 output per million tokens is the lowest cost choice for routine coding work, at half the rate of Opus 5.5.
About the author
AIOPLY Pricing Desk
Independent AI cost research, verified against provider documentation
Every figure in this article was checked against the provider's own pricing page before publication. Where AI assistance is used to draft a routine price report, a human editor verifies the numbers and signs it off.
Our editorial policyQuality standards
Prices were checked against provider documentation on Nov 17, 2026. Rates change without notice, so confirm current figures with the provider before committing a budget. We publish list prices only and take no payment for placement.
Report a correctionSources and further reading
More from the blog
Comparisons
OpenAI Decisions API vs Microsoft Decision-1 | Pricing and Cost per DecisionOpenAI's Decisions API charges $0.10 per million input tokens; Microsoft-Decision-1 lists at $0.042. Cost per decision, limits and when a normal LLM is cheaper.
Model releases
Claude Opus 5.5 Pricing | $4/$20 per M Tokens and Real CostsClaude Opus 5.5 costs $4 input and $20 output per million tokens, 20% below Opus 5. Caching, fast mode, and worked monthly cost examples for real workloads.
Comparisons
Claude Opus 5.5 vs Fable 5.1 | Cost per Task and Which to UseOpus 5.5 is 60% cheaper per token than Fable 5.1. We compare pricing, cost per task, speed claims and where each model still earns its place in your stack.
