How much Claude Code costs per month — and what actually drives the number
Claude Code has no subscription fee on top of the API. Your bill is token spend, and it is driven by one thing almost nobody tracks: how much context each turn resends. Understand that and the bill becomes predictable.
The three numbers that decide your bill
- Context size per turn. Claude Code sends the accumulated conversation on every request. This is the dominant factor, not message count.
- Turns per session. An agent loop that runs 40 tool calls is 40 billed requests, each carrying the context.
- Model rate. The per-million-token input and output price of the model you selected.
Current rates
| Model | Gateway rate in / out per 1M tokens | Official list in / out per 1M tokens | Diff |
|---|---|---|---|
| claude-haiku-4-5 | $0.5 / $2.5 | $1 / $5 | 50% |
| claude-sonnet-5 | $1 / $5 | $2 / $10 | 50% |
| claude-opus-5 | $2.5 / $12.5 | $5 / $25 | 50% |
Rates checked 2026-11-01. Gateway rates move with upstream promotions, verify the current number in your dashboard before committing to a budget.
What that means in practice
Take a realistic working day: 15 sessions, each with about 30 turns, averaging 40k tokens of context per turn. That is roughly 18M input tokens a day. At the rates above the difference between model classes is not marginal It is the difference between a coffee and a dinner, every single day.
Use the Claude Code cost calculator with your own session length rather than trusting a generic figure. Two developers can differ by 10x on the same model purely because of how they manage context.
Six ways to cut the bill without slowing down
| Lever | What it does | Typical effect |
|---|---|---|
| Compact long threads | Runs /compact to summarise history instead of resending it | Largest single saving on long sessions |
| Start fresh per task | One thread per task instead of one thread per day | High — avoids unrelated context being resent |
| Model per task | Cheap model for mechanical edits, expensive one for hard reasoning | High |
| Scope the repo | Keep unrelated large files out of context | Medium |
| Cap output length | Limit long explanations where you only need the diff | Medium — output is the expensive side |
| Batch mechanical work | One well-specified request instead of ten exploratory ones | Medium |
See the full walkthrough in how to reduce Claude API cost.
How to verify your own number
Do not estimate from the CLI. Read the usage log on the provider dashboard, filter to a single day, and divide by the number of sessions you ran. That gives a per-session figure you can actually act on, and it is the only number worth optimising against.
Where the rate comes from
The rate you pay is whatever your provider charges per token It is not fixed by the tool. Comparing that per-token number across models is the highest-leverage check you can do, and it takes a minute in the cost calculator.
How the bill is actually computed
Two numbers are metered separately and added: input tokens (everything you send, system prompt, conversation history, retrieved documents, tool results) and output tokens (what the model generates). Per-token, output is the expensive one (across the 226 models we track), the median output-to-input ratio is 4.0×, and the widest is 12.0×.
And yet on agent-shaped workloads the input side dominates the invoice. That is not a contradiction, it is arithmetic: an agent re-sends its entire context on every turn, so a turn that produces 800 output tokens may carry 60,000 input tokens. At a 4× unit price ratio, the input still accounts for roughly 95% of that turn's cost. Optimising output length on this workload is optimising the wrong end.
| Model | Input / 1M | Output / 1M | Output ÷ input | One agent turn | Input share of that turn |
|---|---|---|---|---|---|
claude-haiku-4-5-20251001 | $0.500 | $2.50 | 5.0× | $0.032 | 94% |
claude-sonnet-5 | $1.00 | $5.00 | 5.0× | $0.064 | 94% |
claude-opus-5 | $2.50 | $12.50 | 5.0× | $0.160 | 94% |
The practical reading: unit price decides, but token shape decides harder. A model that costs twice as much per token can still be cheaper end to end if it needs half as many turns to finish the task, and a prompt that carries 40k tokens of irrelevant history costs the same as one that carries 40k tokens of useful context. Before switching models, measure which side of the sum your workload actually lives on.
Where the money actually goes, ranked
Cost advice tends to be a list of tricks with no ordering. These five are ordered by how much they typically move a real bill, and each one names the number that tells you whether it worked.
| Lever | Why it works | What to measure to know it worked |
|---|---|---|
| Switch to a cheaper model | Unit price drops across every token you send. | Output quality on your actual task (not on a benchmark). |
| Cut context per request | Input is re-sent every turn on agent workloads; trimming it compounds. | Tokens per task, before and after. |
| Cache the stable prefix | A cached prefix is billed below the uncached rate where the provider supports it. | Cache-hit rate in the usage response. |
| Move non-urgent work to batch | Batch tiers trade latency for a lower rate; the work is identical. | Nothing changes in quality, only in when it finishes. |
| Cap output length | Only helps when output genuinely dominates, which it does on generation tasks. | Whether output is actually the larger half of your bill. |
Concretely: one day at 1200k input / 16k output costs $3.20 on claude-opus-5 and $1.28 on claude-sonnet-5 (a difference of $1).92 per day, or $38.40 over a 20-day month.
The ordering is not universal, it depends on your token shape. On agent loops, context size outranks model choice; on bulk generation, model choice wins because there is no context to trim. Work out which half of the sum your workload sits on before spending effort on the wrong lever. Our output vs input pricing breakdown covers how to tell.
Why the estimate and the invoice disagree
| Symptom | What is actually happening | How to confirm | Fix |
|---|---|---|---|
| A session that should cost pennies costs dollars | The agent is resending a large context every turn, and input is billed each time. | Divide total input tokens by number of turns If it matches the context size, this is it. | Narrow the files in scope, or restart the session so the history resets. |
| Cost is flat but output quality dropped | A cheaper model is being used for work that needed the expensive one. | Check which model ID appears in the usage log for the failing sessions. | Route mechanical tasks to the cheap model and keep hard reasoning on the strong one. |
| The bill jumps on days with no unusual work | A retry loop, a failing test loop, or an unattended long-running session. | Group usage by hour in the log, spikes usually align with one runaway session. | Set a spend ceiling, and cap retries on failing tool calls. |
| Estimates never match the invoice | Estimates usually assume one pass; real sessions retry, branch and re-read files. | Compare assumed turns per task against actual requests per task. | Model cost per task, not per message, and measure it once before extrapolating. |
FAQ
How much does Claude Code cost per month?
It is pure token spend There is no seat fee on top. A light user (a few sessions a day, short threads) lands in the low tens of dollars. A heavy user running long agent sessions every working day can reach several hundred. The multiplier is not the number of messages, it is how much context each turn resends.
Why does the cost grow so fast in long sessions?
Every turn sends the accumulated conversation back to the model. Input is billed per token each time, so a 200k-token context resent 50 times costs the same as sending 10M input tokens, even though you typed a few hundred words.
Does a cheaper model actually work for Claude Code?
For mechanical tasks, renaming, formatting, running tests, applying a described change, yes, and it is the single biggest saving available. Reserve the expensive model for the parts where a wrong answer costs you an hour.
How do I find out what I am actually spending?
Check the usage log on your provider dashboard rather than inferring it from the CLI. For a forward-looking estimate, use the Claude Code cost calculator with your real session length.
Is there a way to cap the bill?
Set a top-up ceiling on the account and keep conversations short. There is no per-request hard cap inside the CLI itself, so the account-level limit is the reliable brake.
How much does Claude Code cost per token?
Whatever your model's published rate is (Claude Code adds no per-token markup of its own). It bills input and output separately at the model's own rates, and the reason the number feels opaque is that the CLI decides how many tokens to send, not you: every turn resends the working context. That is also why output tokens dominate the bill on agent workloads.
Does Claude Code cost more in agent mode?
Yes, materially. Each agent turn re-reads the files in scope plus the accumulated history before it writes anything, so a session that looks like a handful of edits can consume a large multiple of the final diff in tokens. Narrowing what is in scope, fewer files, shorter sessions, a smaller CLAUDE.md (usually saves more than switching to a cheaper model).