If you've started using an AI coding agent (Claude Code, Cursor's agent, Codex, or something you built yourself on an API), you've probably had this moment: the agent ran for twenty minutes, fixed the bug, and then you saw the bill.
The pricing pages list costs "per million tokens", which tells most people nothing. So here's an attempt to turn that into dollars per month for a realistic workload, with the formula shown so you can redo it for your own setup.
Disclosure: We run Agent Cost Hub, a small site that tracks LLM API prices. AI helped draft this article, and every number below comes from list prices checked on **2 Nov 2026. Prices change often, so treat these as a snapshot.
First: why agents cost more than chat
A chatbot sends one request per question. An agent works in a loop: read the files, plan, edit, run the tests, read the error, edit again. Each of those steps is a separate API call, and each call resends the whole context (your instructions, the files it has read, the conversation so far).
So a single "fix this bug" task can easily be 10–20 calls of roughly 20,000 input tokens each. That's where the money goes. It's input tokens multiplied by the number of steps, not the short answer you see at the end.
The workload we'll price
To compare models fairly, we'll use one fixed, fairly typical workload for a small team or a busy solo developer:
- 50 tasks per day
- 15 steps per task
- 20,000 input tokens and 1,500 output tokens per step
- 50% of the input served from the prompt cache (more on that below)
- 30 days a month
The formula is:
monthly = steps × (input × (1 − cached%) × input_price
+ input × cached% × cached_price
+ output × output_price) ÷ 1,000,000
× tasks_per_day × 30
The formula leaves out cache-write fees and any subscription discounts. These are plain API list prices.
The numbers (2 Nov 2026)
| Model | Price per 1M tokens (in / out / cached) | Per task | Per month |
|---|---|---|---|
| Claude Haiku 5.5 | $0.10 / $0.50 / $0.01 | $0.03 | $42 |
| GPT-5 Mini | $0.25 / $2 / $0.025 | $0.09 | $129 |
| Gemini 3.8 Flash | $0.75 / $3.75 / $0.075 | $0.21 | $312 |
| GPT-5 | $1.25 / $10 / $0.125 | $0.43 | $647 |
| Claude Sonnet 5.5 | $2 / $10 / $0.10 | $0.54 | $810 |
| Kimi K3 | $3 / $15 / $0.30 | $0.83 | $1,249 |
| Claude Opus 5.5 | $4 / $20 / $0.20 | $1.08 | $1,620 |
That's a ~39× spread between the cheapest and the most expensive model for exactly the same work.
Two things stand out:
- The per-task cost looks tiny, but the monthly cost doesn't. $1.08 per task sounds fine until you multiply it by 50 tasks a day.
- Output is pricier per token, but input is where the volume is. In our workload, each step reads 20,000 tokens and writes 1,500. For Opus 5.5, input (including cached reads) is about 58% of the bill even with half of it cached.
Cheaper doesn't automatically mean "just as good". The smaller models will fail more often on hard tasks, and a failed task that you rerun costs twice. Still, many teams pay top-tier prices for tasks a mid-tier model handles fine.
5 ways to cut the bill
1. Make the prompt cache work for you
Most providers charge much less for input they've seen recently: often 10% of the normal input price, sometimes less. For an agent, the instructions, tool definitions and files at the top of the context stay the same from step to step, which makes them ideal for caching.
Here's the effect on Opus 5.5 with our workload:
| Cached share of input | Per month |
|---|---|
| 0% | $2,475 |
| 50% | $1,620 |
| 90% | $936 |
The cache only matches if the beginning of the prompt stays identical. A timestamp, a reordered list of tools, or a changed system prompt at the top breaks the match for everything after it. Put stable content first and changing content last.
2. Use fewer steps per task
Every step resends the context, so shorter loops save money directly. Cutting our Opus example from 15 steps to 8 brings it from $1,620 to $864 a month.
What helps in practice:
- Give the agent a precise task ("fix the failing test in
auth.test.ts") rather than a vague one ("improve auth"). - Point it at the right files so it doesn't have to search.
- Paste the exact error message instead of "it doesn't work". Guessing burns steps.
3. Keep the context small
- Start a new session for each new feature. A long thread means every new message drags the whole history along. Ask for a 10-line summary first and paste it into the new session.
- Turn off tools you don't need. Every connected MCP server and tool description is sent on every step. Ten unused tools are pure overhead.
-
Keep instruction files short. A 3,000-token
AGENTS.mdthat loads on 750 steps a day is over 2 million tokens a day before any work happens.
4. Route easy work to a cheap model
Not every step needs the smartest model. Renaming variables, writing docstrings, summarizing a log or drafting a commit message are jobs a small model handles well.
As a rough illustration, if 80% of the tasks went to Haiku 5.5 and 20% to Opus 5.5, the same workload would cost about $357 a month instead of $1,620. Your split will differ, but the principle holds: save the expensive model for the hard 20%.
5. Watch the reasoning setting and output length
"Thinking" or high reasoning-effort modes generate hidden reasoning tokens that are billed as output, and output is the expensive side. Medium effort is enough for most edits. Use high effort only for genuinely tricky problems.
Also ask for diffs or only the changed lines, not whole rewritten files. Halving the output tokens in our Opus example saves about $340 a month on its own.
Check this for your own setup
Your numbers will differ from the example: maybe 5 tasks a day, maybe 40 steps, maybe a different model. Two free ways to rerun the calculation:
- The calculator on agentcosthub.com lets you plug in your own tokens, steps and volume across 79 models. It also has a "Find my setup" helper if you're not sure what numbers to use.
- If you use Claude or Cursor, you can connect the free, read-only Agent Cost Hub MCP server. It needs no sign-in, and you can then ask your assistant things like "what would a coding agent cost on GPT-5 vs Sonnet 5.5?" directly in chat. The code is open source on GitHub.
Quick recap
- Agents cost more than chat because every step resends the whole context.
- With identical work, the same agent costs anywhere from ~$42 to ~$1,620 a month depending on the model (prices as of 2 Nov 2026).
- The biggest levers are caching, fewer steps, a smaller context, sending easy work to a cheap model, and controlling reasoning and output length.
- Measure a few real tasks before and after each change. That's the only way to know what's actually working for you.
What does your agent cost you per month? We're curious what step counts people are seeing in practice. Share them in the comments.
Top comments (2)
A monthly bill hides the number that matters: cost per task that actually passes. A cheap month can just be one where the agent gave up early, and the bill looks better for it. Do your per-task figures count the runs that gave up?
The point about the cache only matching when the start of the prompt stays identical is easy to miss. A timestamp in the system prompt can quietly cost you the whole 50% saving, so I'd check that nothing dynamic sits above the tool definitions.