Agent Cost Calculator
Inputs
| Number of Steps | 8 |
|---|---|
| Input Tokens per Step | 4,000 |
| Output Tokens per Step | 600 |
| Input Price (per 1M tokens) | 3 $ |
| Output Price (per 1M tokens) | 15 $ |
Agent Cost Calculator
Estimate the cost of one agentic LLM run from the number of steps, the input and output tokens consumed per step, and the model’s per-million-token prices, with input and output billed separately.
Inputs
Agent run
Pricing
Results
Enter a value to see results.
Details
Agent cost explained
The cost of an agentic run is the combined price of the sequence of large language model calls an agent makes to complete one task. An agent alternates between reasoning, calling a tool, and incorporating the result, with each model invocation counting as a step. Because every step is billed for the tokens it consumes, the run cost is the per-step cost multiplied by the number of steps — typically several times the cost of a single direct call.
Why multi-step runs cost more
A one-shot request bills for one prompt and one completion. An agent loop bills for both at every step, and the input side grows as the run proceeds: each step re-sends the accumulated context — the original instructions, prior reasoning, and every tool result so far — so the model can act with full history. A task that a single call would resolve for a fraction of a cent can cost many times that once the same context is paid for across a dozen steps.
The formula
With input and output tokens per step at per-million prices and , the cost of one step is
Cs=106ninpin+noutpoutand a run of steps costs
C=CsNThis treats every step as consuming the same token count, which keeps the arithmetic simple at the cost of ignoring the growth of context across the run.
Worked example
Consider an N = 8 step run where each step sends 4000 input tokens and generates 600 output tokens, priced at $3 and $15 per million. The per-step cost is
Cs=1064000×3+600×15=10612000+9000=$0.021so the run costs C = 0.021 \times 8 = \0.168$. The large input figure reflects context being re-sent each step; here the 4000 input tokens at the lower rate still contribute more than half of each step's cost, and the eight-fold repetition is what separates an agent run from a single call.
Notes and variations
The uniform-step assumption understates real cost when context accumulates, since later steps carry more input than earlier ones. For a precise figure, sum the steps individually rather than multiplying an average. Prompt caching is especially effective here, because the stable portion of the context — the system prompt and early history — repeats at every step and can be billed at a reduced rate after the first call.
Application
Agent cost extends the per-call model to workflows that loop. The single-step price it builds on is the subject of the Token Cost Calculator, and scaling a run to a daily or monthly fleet of tasks is handled by the LLM Monthly Cost Calculator. Because re-sent context dominates the input bill, Prompt Caching Savings Calculator quantifies the discount caching can recover.
Frequently Asked Questions (FAQ)
What counts as an agent step?
A step is one call to the model within an agentic loop. An agent typically alternates between reasoning, calling a tool, and incorporating the tool result, with each model invocation counting as a step. The total number of steps in a run depends on the task and how many tool calls the agent decides to make.
Why are input and output tokens priced differently?
Reading the prompt and generating the reply are different workloads. Input tokens are processed in a single parallel forward pass, while output tokens are produced one at a time, each requiring a full pass over the model. Generation is therefore more compute-intensive, and providers price output tokens higher to reflect that — commonly three to five times the input rate.
Do all steps really use the same number of tokens?
No. This model assumes a uniform per-step token count for simplicity. In practice the input grows as context accumulates across steps, so later steps usually cost more than earlier ones. Use the average tokens per step to approximate the run, or sum individual steps for a precise figure.
Disclaimer
Token counts depend on the model’s tokenizer and on how context accumulates across an agentic run. Published prices change over time and may exclude discounts for caching or batch processing. Verify current rates and typical token usage with your provider before relying on a figure for budgeting.