AI Agent Cost Calculator
Estimate per-task cost for AI agents from multi-step reasoning, tool calls, and context accumulation.
About this calculator
An AI agent's per-task cost is not just "tokens times price" the way a single chat completion is, because an agent that takes multiple reasoning or action steps typically carries forward context from earlier steps into each new one -- the model has to re-read its prior plan, tool results, and reasoning at every step, so the token bill grows faster than the step count alone would suggest. This calculator models that growth with a simple assumption: average context carried into a step scales with how far into the task the agent already is, so total input tokens for a task scale roughly with the square of the step count rather than linearly with it -- a task that takes twice as many steps can cost noticeably more than twice as much in LLM tokens alone, before tool calls or retries are even added. Tool calls (web search, code execution, API lookups) are priced completely separately from LLM tokens, using a flat per-call cost you set rather than a token count, since most external tools bill per request or per compute-second rather than per token.
Retry rate is applied as a simple multiplier on top of the combined LLM-and-tool cost, representing the added expense of steps that fail and have to run again -- it does not change how many tokens or tool calls a single successful task consumes, only how much of that cost gets paid more than once. Because LLM provider pricing changes frequently, treat the input/output price-per-million-token fields as placeholders to fill in with your own provider's current published rates rather than figures this calculator keeps up to date on its own.
Inputs
Results
Cost per task ($)
$0.15
Monthly cost ($)
$227.70
How to Use This Calculator
- Enter Tasks per Day — the number of agent jobs your system executes daily.
- Set Avg Steps per Task (e.g., 5 for simple tasks, 10–15 for complex reasoning chains) and Tokens per Step.
- Enter Tool Calls per Task and Cost per Tool Call to capture external API expenses like web search or code execution.
- Set Input Price and Output Price per 1M tokens from your chosen LLM provider's pricing page.
- Adjust Retry Rate (%) for expected step failures, then review Cost per Task, Monthly Cost, and Daily Tokens to budget your AI operations.
How the result changes with Avg steps per task
| Avg steps per task | Cost per task ($) | Monthly cost ($) |
|---|---|---|
| 2.5 | $0.08 | $116.94 |
| 3.75 | $0.11 | $166.91 |
| 7.5 | $0.25 | $381.77 |
| 13 | $0.58 | $873.18 |
What each input means
- Tasks per day
- Number of agent tasks executed per day.
- Avg steps per task
- Average number of reasoning/action steps the agent takes per task. Simple tasks: 2-3, complex: 8-15.
- Tokens per step
- Base tokens consumed per agent step (input + output before context growth).
- Tool calls per task
- Average number of external tool/API calls per task (web search, code execution, etc.).
- Cost per tool call ($)
- Average cost per external tool call (API fees, compute, etc.).
- Input price per 1M tokens ($)
- LLM input token price. GPT-4o: $2.50, Claude Sonnet: $3.
- Output price per 1M tokens ($)
- LLM output token price. GPT-4o: $10, Claude Sonnet: $15.
- Retry rate (%)
- Percentage of steps that require retry due to failures, adding to cost.
What each result means
- Cost per task ($)
- Total cost per agent task including LLM, tools, and retries.
- LLM cost per task ($)
- Token cost per task (accounts for cumulative context growth across steps).
- Tool cost per task ($)
- External tool/API call cost per task.
- Daily cost ($)
- Total daily agent operating cost.
- Monthly cost ($)
- Projected 30-day agent cost.
- Annual cost ($)
- Projected 365-day agent cost.
- Tokens per task
- Total tokens consumed per task (input + output with context growth).
- Daily tokens (millions)
- Total daily token consumption in millions.
How this is calculated
Worked example, using the default values
- Identify Input Parameters8 parametersTasks per day = 50, Avg steps per task = 5, Tokens per step = 2000, Tool calls per task = 3, Cost per tool call = 0.01, Input price per 1M tokens = 3, Output price per 1M tokens = 15, Retry rate = 10 = 8 input(s) provided
- Calculate Cost per taskCost per task = (llmCostPerTask + toolCostPerTask) * retryMultiplier0.1518 = $0.152
- Calculate Monthly costMonthly cost = dailyCost * 30227.7 = $227.7
- Calculate LLM cost per taskLLM cost per task = llmInputCostPerTask + llmOutputCostPerTask0.108 = $0.108
- Calculate Tool cost per taskTool cost per task = toolCallsPerTask * toolCallCost0.03 = $0.03
Engine last updated . Checked against 3 independently-derived tests — how we verify calculators. Built by Paul Gunder, a software engineer, not a licensed financial, medical, or legal professional.
Frequently Asked Questions
Why does token cost grow faster than the number of steps in a task?
Each step in a multi-step agent task typically carries forward context from every prior step -- the model re-reads its earlier plan and tool results before deciding what to do next -- so this calculator models the average context per step as scaling with how many steps have already happened. That makes total input tokens per task grow roughly with the square of the step count rather than linearly, so doubling the number of steps in a task more than doubles its LLM token cost even before tool calls or retries are added on top.
Why is tool call cost calculated separately from token cost?
Most external tools an agent calls -- web search APIs, code execution sandboxes, database lookups -- are billed per request or per compute-second by their own provider, not per token consumed by the LLM, so this calculator treats tool call cost as a flat per-call price you set rather than folding it into the token math. That keeps the two cost sources independently adjustable: changing your LLM provider's token price has no effect on tool cost, and vice versa.
Does retry rate change how many tokens a task consumes?
No -- retry rate is applied as a multiplier on top of the combined LLM and tool cost for a single successful task, representing how often that cost gets paid more than once because a step failed and had to run again. It does not change the token count or tool-call count calculated for one pass through the task, so tokens-per-task stays the same regardless of what you set the retry rate to.
Why does the calculator list example GPT-4o and Claude prices in the help text?
Those figures are illustrative starting points to show the rough range LLM providers charge per million tokens, not prices this calculator tracks or updates automatically -- provider pricing changes over time and varies by model tier. Always replace the input and output price fields with your chosen provider's current published rate before relying on the cost estimate for budgeting.
Related Calculators
The questions that sit next to this one — chosen by subject, including calculators filed under a different category.
AI Model Cost Comparison Calculator
Compare per-token and per-request costs across AI providers including GPT-4o, Claude, Gemini, and self-hosted Llama.
Ai ToolsLLM Token Calculator
Estimate token count and API cost from text length across different tokenizers (GPT-4, Claude, Llama).
Ai ToolsPrompt Engineering Cost Calculator
Calculate the true cost of iterative prompt development including API tokens and engineer labor time.
More in Technology & Computing.