Coding agent: monthly LLM API cost calculator
Coding agents are the most expensive common workload per request: a large repository context, tool results replayed on every step, and long diffs as output. They are also the best caching story on this site, because the repository prefix is typically identical across every step in a session. A 75% hit rate on 48K tokens is not optimistic — it is the normal case for a well-designed agent loop.
Workload snapshot
Requests / day
400
including retries
Input tokens
48,000
per request
Cache hit rate
75%
of input tokens
Output tokens
3,500
per request
Active days
26
per month
Claude Opus 5.5
$1,302
per month at this workload
Claude Sonnet 5.5
$651.04
per month at this workload
DeepSeek V4 Pro
$325.35
per month at this workload
Estimated at December 2026 reference list pricing with the defaults above. Adjust the sliders below for your own numbers.
Model your own numbers
The workload above is already loaded. Change any input and every model re-prices instantly.
Completed API calls per day, including retries.
System prompt, context and history you send.
Share of input tokens served from a warm cache.
Generated answer length. Output usually costs 5x input.
22 for business tools, 30 for always-on traffic.
| Model | Input /1M | Cached /1M | Output /1M | Monthly | Relative cost | vs highest |
|---|---|---|---|---|---|---|
| Claude Haiku 5.5Anthropic | $0.1 | $0.01 | $0.5 | $34.42 | -99% | |
| DeepSeek V4.1 FlashDeepSeek | $0.3 | $0.006 | $1.2 | $83.37 | -98% | |
| Custom ModelYour numbers | $1.00 | $0.1 | $2.00 | $235.04 | -93% | |
| Gemini 3.8 FlashGoogle | $0.75 | $0.075 | $3.75 | $258.18 | -93% | |
| DeepSeek V4 ProDeepSeek | $1.32 | $0.044 | $3.96 | $325.35 | -91% | |
| Claude Sonnet 5.5Anthropic | $2.00 | $0.1 | $10.00 | $651.04 | -81% | |
| Gemini 4 NeonGoogle | $2.00 | $0.1 | $10.00 | $651.04 | -81% | |
| GPT-6.1 SolOpenAI | $2.00 | $0.1 | $10.00 | $651.04 | -81% | |
| Gemini 4 CarbonGoogle | $3.00 | $0.15 | $15.00 | $976.56 | -72% | |
| GPT-4o (Legacy)OpenAI | $2.5 | $1.25 | $10.00 | $1,144 | -67% | |
| Claude Opus 5.5Anthropic | $4.00 | $0.2 | $20.00 | $1,302 | -62% | |
| GPT-6.2 AstraOpenAI | $10.00 | $1.00 | $50.00 | $3,442 | baseline |
Sorted cheapest first. Bars are scaled to the most expensive model at your current inputs.
Cost-optimisation checklist
- Keep the file context prefix byte-stable. Changing the order of files, timestamps or a header comment between steps invalidates the cache and re-bills 48K tokens each time.
- Truncate tool output aggressively. A test run that dumps 10,000 lines of logs into the context is a direct cost increase on every subsequent step.
- Prefer targeted file reads over whole-directory dumps. The model rarely needs more than the files it is editing plus their imports.
- Use a cheap model for planning and file search, and a strong one for the actual edit. Agents that call the frontier model for `ls` are burning budget.
- Bound the agent loop. A step limit of 20 instead of 60 caps worst-case spend per task and usually improves output quality.
Cost questions about coding agent
Why is an agent step so expensive?
Because every step resends the whole working context. At 48K input tokens and 3.5K output tokens, one step costs roughly 0.03-0.08 dollars on a mid tier. Multiply by steps per task and tasks per day and the monthly total reaches four figures quickly.
Does caching really help agent loops?
It is the dominant lever. At a 75% hit rate, 36,000 of the 48,000 input tokens bill at 5% of the input rate. Drop the hit rate to 20% in the slider and watch the monthly total roughly double.
Which model should back a coding agent?
Use a strong mid tier for most edits and reserve the frontier tier for architecture and hard debugging. The edit-apply loop is high volume; the reasoning that decides the design is low volume.