AI agent cost calculator: per run, per completed task and per month
An agent task usually costs more than one model call: planning, tool selection, tool results, retries and the final answer are all billed. Enter calls per run, tokens per call and your retry rate to see cost per run, cost per completed task and the monthly bill at the same official list rates used across this site.
Why an agent task costs more than one call
Every step is billed
A single completion is one request. An agent run is usually several: a planning call, a call that chooses a tool, a call that reads the tool result, sometimes an evaluation call and a final answer. Each request sends the conversation and tool output again, so input tokens are re-billed at every step, and each retry repeats the whole round.
The calculator below prices that loop from the verified list rates in src/prices.json. Enter your own calls per run and retry rate rather than trusting a default: those two numbers move the estimate more than the model choice does.
Estimate the cost of one agent task
Worked examples: one call versus a five-step loop
Same task, different number of model calls
2,000 completed tasks per month, standard short-context list rates. The single-call row is a plain completion. The other rows model a five-step agent where each call re-sends 4,000 input tokens and asks for 400 output tokens, with and without a 20% retry rate.
| Workload | Model | Retry rate | Per run (one attempt) | Per completed task | Monthly at 2,000 tasks | What it models |
|---|---|---|---|---|---|---|
| Single call | GPT-5.4 mini rate | 0% | $0.00375 | $0.00375 | $7.50 | A one-shot request with no tools |
| 5-step agent | GPT-5.4 mini rate | 0% | $0.0240 | $0.0240 | $48.00 | Planning, tools and a final answer |
| 5-step agent | GPT-5.4 mini rate | 20% | $0.0240 | $0.0300 | $60.00 | Same agent, 20% retry rate |
| 5-step agent | Claude Sonnet 5.5 rate | 20% | $0.0600 | $0.0750 | $150 | Same agent on a mid-tier model |
A retry rate of 20% means one extra attempt for every five tasks: the monthly bill rises by a quarter, and the cost per completed task rises by the same share. This table excludes tool API fees, hosting and subscription tiers.
How to make the number smaller
Four levers, in order of impact
Cut retries first (better tool schemas and validation beat almost any model swap), then trim the number of steps, then shrink what each step re-sends, and only then consider a cheaper model. Caching helps when the instruction block repeats across steps; it does not help when every step appends new tool output to the context.
What this estimate does not include
Tool and search API fees, hosting, framework or platform fees, long-context or priority tiers, batch pricing and any failed call whose tokens the provider still bills. This is a planning estimate at standard list rates, not a quote or an invoice reconciliation.
Related calculators
- RAG cost calculator: per query, per 1,000 questions
- What coding agents, skills, plugins and MCP servers burn in tokens
- MCP server token cost per call
- Turn the monthly bill into a per-user price
- Self-host vs API break-even
- Compare every verified model for one workload
- Every model price per 1M tokens
Questions
How much does an AI agent cost per task?
It is the model rate for one call multiplied by the number of calls the run makes, then divided by the success rate. A five-step run that sends 4,000 input and 400 output tokens per call costs about eight cents on a small model and about six cents on a mid-tier one, before retries. Retries are the fast multiplier: at a 20% retry rate the same task costs a quarter more per completed task.
Why do retries increase cost per completed task, not per run?
A failed attempt still bills its tokens. If one in five runs needs an extra attempt, the total bill rises by about a quarter while the number of completed tasks stays the same, so cost per completed task rises with it. The calculator separates cost per run from cost per completed task for exactly this reason.
Should I use a cheaper model for tool calls?
Often, yes: routing tool selection and summarisation to a cheaper tier while a stronger model plans or writes the final answer is a common pattern. This calculator assumes one model for every step, so it over-estimates a mixed setup; model the cheap steps separately with their own call counts.
Does prompt caching help agents?
It helps when a fixed instruction or schema block repeats on every step. It helps less when each step appends new tool output, because the cached prefix changes. The calculator applies the cached-input rate; check each model row for whether a cached rate exists and remember that some providers charge a cache-write premium.
How many calls does a typical agent run make?
We do not publish a measured average, because it depends on the framework and the tools. Count the requests in your own logs or traces for one week and use that number; a single-call assumption for a tool-using agent is the most common way to under-budget.
What is not in this estimate?
Tool and search API fees, hosting, framework or platform fees, long-context or priority tiers, batch pricing, and failed calls the provider still bills. All rates are standard short-context list prices from src/prices.json.
Next step → Turn this monthly bill into a price per user
Price data last checked 2026-11-18 against official sources · how we verify
Price-change alerts
One short email when a provider changes a price or a promo ends. No spam, unsubscribe any time.