How this calculator works
The AI Agent Step Cost Calculator estimates the total token bill of running an autonomous agent through a multi-step task. Because most agents re-send their accumulating context on every step, the cost does not grow linearly — it compounds as earlier reasoning, tool outputs, and instructions pile up in each new request. This tool computes that running total from the inputs you provide: the number of steps per task, the fixed system and base tokens present in every call, the added context per step that swells each subsequent request, the output tokens per step, and your per-million rates for input and output tokens. The dominant driver is usually the growing input side: a task that looks cheap per step can become expensive once the same context is re-read dozens of times.
The key trade-off to watch is step count versus context growth. Adding steps is rarely free, because each new step also re-sends everything accumulated before it, so input cost scales roughly with the square of the steps rather than in a straight line. A practical tip is to run the calculator twice — once with your expected step count and once with a longer worst-case run — to see how fast the bill climbs when an agent loops or retries. If the projected cost is dominated by input tokens, the highest-leverage fixes are trimming or summarizing carried context, capping the number of steps, and keeping the base prompt lean rather than reducing output length.
Frequently asked questions
Why are AI agents so expensive?
Agents run in a loop, and each step re-sends the growing history — system prompt, prior reasoning and every tool result so far. That accumulated context is billed as input again on every step, so a multi-step task costs several times more than a single call, even before counting the extra output.
How do I control agent token costs?
Summarise or truncate the scratchpad instead of carrying full history, cap the number of steps, prune verbose tool outputs before feeding them back, cache the stable system prompt, and use a cheaper model for routine steps. The lever is the re-sent context, which grows every step.