AI agent cost calculator
Set to a 20-step coding agent: a large system prompt, tool results coming back every step, and the full history resent each time. See what a month of runs costs.
$0.00
$0.00
- Input tokens per session
- Output tokens per session
- Longest request with reply
Turn by turn, one session
| Turn | Input that turn | Total so far | With caching |
|---|
Why agents cost more than chat
An agent calls the model many times per task. Each step sends the instructions, the tool definitions, and every earlier step’s inputs and outputs, so later steps are far larger than early ones.
Tool results are often the biggest part: file contents, search results and test logs flow back into the context and stay there.
Keeping agent costs in check
Caching the stable prefix is the biggest lever. After that, trim tool output before it re-enters the context, and cap the number of steps per task.
Watch the context column: a run that overflows the window fails or gets truncated, which costs more in retries than it saved.
| Agent | System + tools | Per step in | Per step out | Steps |
|---|---|---|---|---|
| Coding agent | 5–10K | 1–5K (files, logs) | 500–1.5K | 10–40 |
| Research agent | 2–4K | 3–8K (web pages) | 300–800 | 5–15 |
| Support agent with tools | 1–3K | 200–1K | 200–500 | 3–10 |
Other AI setups
- OpenAI API cost calculator5 models
- Claude API cost calculatorHaiku · Sonnet · Opus
- Gemini API cost calculatorFlash · Pro
- DeepSeek API cost calculatorOff-peak rates
- Prompt caching savings calculatorCached vs uncached
- AI agent cost calculator
- Context window calculator128K to 1M
- Private token counter
Related
Questions
How much does an AI coding agent cost per task?
With the default numbers here, a 20-step run on Claude Sonnet 5.5 costs about $1.75 without caching and about $0.50 with it. Your files and step count change this a lot.
Why does the cost per step keep rising?
Because each step resends everything before it. The 20th step carries 19 earlier steps of history.
Should agents use a cheaper model?
Often a mix works best: a cheap model for routine steps like reading files, a stronger one for planning and final edits.
What happens when the context window fills up?
The request fails or the oldest content must be dropped or summarized. The simulator warns when the longest step would not fit.