The trap with agents: a task that looks like one question is really 5–20 LLM calls. A chatbot replies once. An agent reasons, calls tools, and re-reads its own growing context every step — so the same model that costs a fraction of a cent per chat message can cost 10–50× that per agent task. This calculator multiplies it out properly.
Cheapest models for this agent
Same workload, every model ranked by monthly cost.
| Model | Cost / month | Per task |
|---|
How agent cost actually adds up
The formula is tasks × steps × (input tokens × input price + output tokens × output price). The multiplier people forget is steps: a research agent might take 12 loops, a coding agent 20+. And because most agents resend the accumulated conversation each step, input tokens per step climb as the task goes on — the number you enter above is the average across the whole loop. Output is usually small per step (a short thought or a tool call), which is why input dominates the agent bill — and why prompt caching and context trimming matter more here than anywhere else.
How to cut it
Four levers, in order of impact: (1) model routing — use a small model for routine steps and a frontier model only for the hard ones; (2) step cap — stop runaway loops; (3) context trimming — don't resend the entire history every step; (4) prompt caching for the static system prompt and tool definitions. See the prompt caching guide and the caching savings calculator. Building a chatbot instead of an agent? Use the chatbot cost calculator. Whole app? The AI app cost estimator. Running more than one agent on the same task — fan-out, debate, supervisor or swarm patterns? This calculator prices a single agent; use the AI agent swarm cost calculator to see the multiplier those orchestration patterns add on top.