What Is the AI Agent Cost Calculator?
This calculator estimates what it costs to run an LLM-powered agent at scale. You give it the average number of steps a task takes, the tokens each step burns, how many tasks you run per day, and the model you are using; it returns the tokens per task, cost per task, daily cost, and monthly cost. The core formula is simple: cost = (input tokens ÷ 1M × input price) + (output tokens ÷ 1M × output price), multiplied by the number of requests. The catch that surprises most teams is that the same task run 1,000 times a day is a very different bill from running it once — this tool shows both.
A Worked Example: Output Tokens Dominate the Bill
Say one task sends 1M input tokens at $3 per million and generates 500K output tokens at $15 per million. Input costs $3.00 and output costs $7.50, for $10.50 per task — and notice the output side is more than double the cost despite being half the token count, because generated tokens are priced several times higher than tokens you send in. Now run that task 1,000 times: 1,000 × $10.50 = $10,500. Cutting the prompt in half saves $1,500; cutting the generated output in half saves $3,750. That asymmetry is why trimming responses beats trimming prompts almost every time.
Why Agent Loops Change the Math
A single LLM call is easy to price. An agent is a loop — it calls the model, acts on the result, feeds the outcome back, and calls again, sometimes retrying on failure or reflecting on its own work. Each pass carries the accumulated conversation, so token use per step climbs as the task runs, and an unbounded loop can rack up far more steps than you planned. That is where budgets quietly blow up. Estimating steps and tokens per step here, then capping both in your code, keeps an agent from turning a $0.67 task into a $6 one.
AI Agent Cost Calculator
How to Use This Calculator
- Enter Your Avg Steps per Task: Set how many model calls a typical task takes. A one-shot answer is 1; a tool-using agent that plans, acts, and checks its work is often 10 to 20. If retries are common, round up.
- Fill In Tokens per Step and Volume: Enter the combined input-plus-output tokens a single step consumes, then your tasks per day, model, and days per month. If you have real SDK usage numbers, use the measured average rather than a guess.
- Click Calculate: Run the numbers. You get tokens per task, cost per task, and both daily and monthly totals at the selected model's rate.
- Compare and Stress-Test: Switch the model, bump the step count to mimic a retry-heavy loop, or raise tasks per day to see where the monthly bill lands. The gap between a cheap model and a premium one at your volume is usually the deciding number.
How It Works
Every call your agent makes bills on two token streams: the prompt you send in and the text the model generates back. This calculator counts both across all the steps in a task, prices them at the model's per-million rate, then scales that single-task cost up to your daily and monthly volume.
The basic rule:
- Cost per Task = Steps × Tokens per Step × Average Token Rate
Because the model rereads the growing conversation on every step, an agent that takes 15 steps rarely uses 15× the tokens of one step — it uses more, since each step carries the accumulated history. Treat the monthly figure as a floor and add headroom for retries.
Tips & Considerations
- Output tokens are where the cost concentrates — a shorter generated answer usually saves far more than a shorter prompt.
- Your tokens-per-step figure should account for the growing conversation: later steps carry all the earlier history, so an average pulled from real runs beats the token count of a single step.
- Add a retry buffer. If tasks fail and re-run even 20% of the time, model that by raising steps per task rather than trusting the happy-path number.
- Run the cheap model and the premium model side by side at your real volume before committing — higher volume can flip which one is actually cheaper.
- Prompt caching can slash the input half of your bill when the system prompt and tool definitions repeat every step; if you use it, lower your effective tokens-per-step accordingly.
Frequently Asked Questions
Why do output tokens cost several times more than input tokens?
Generating text is more compute-heavy than reading it. The model produces output one token at a time, running a full forward pass for each one, while input tokens are processed in parallel in a single pass. Providers price that difference in — output often runs 4× to 5× the input rate. Take a task with 1M input tokens at $3/M and 500K output at $15/M: input costs $3.00, output costs $7.50, so the output half is more than double the bill despite being fewer tokens. Anywhere you can trade a long generated answer for a short one, you save real money.
How do I estimate token counts before I have real usage data?
A rough English-language rule is about 4 characters or 0.75 words per token, so 1,000 words lands near 1,300 tokens. For agents, estimate per step: count the system prompt, tool definitions, and accumulated conversation as input, and the model's reasoning plus tool calls as output. Then multiply by your expected step count. Most provider SDKs return exact input and output token counts on every response, so once you run a handful of real tasks, replace your estimate with the measured average — that is the number worth plugging in here.
How do agent loops blow the cost up so fast?
Two compounding effects. First, the conversation grows: on step 10 the model rereads everything from steps 1 through 9, so input tokens climb with each turn rather than staying flat. Second, retries and self-correction add steps you did not plan for — a failed tool call, a reflection pass, or a loop that cannot decide it is done can double or triple the step count. A task you budgeted at 15 steps can quietly run 40. Cap the maximum steps, log token usage per task, and alert when a task exceeds its budget.
How do I cut the cost of running an LLM agent?
Route by difficulty — send simple classification, extraction, and routing subtasks to a cheaper model and reserve the expensive one for hard reasoning. Cache the stable parts of your prompt (system instructions, tool schemas, retrieved documents) so you are not paying to reprocess them every step. Trim the context you carry forward instead of appending the full history. Set a hard step ceiling. And shorten outputs: ask for structured or terse responses, since output tokens are where the money goes.
How much do AI agents cost to run?
It depends entirely on the model, task length, and volume. As a worked example, a single agent task using Sonnet-tier pricing with 15 steps at 5K tokens per step costs roughly $0.67. At 50 tasks per day that is about $33/day or $1,000/month. Swap to a cheaper model and it drops severalfold; move to a top-tier model or add retry loops and it climbs just as fast. Run your own numbers in the calculator above.
Does this calculator send my numbers anywhere?
No. The math runs entirely in your browser, nothing is uploaded, and there is no signup. Adjust the inputs as often as you like to compare models or volume scenarios.