Practical guide

AI Agent Cost per Run: A Step-by-Step Estimate

Estimate an AI agent run from model-call count, tokens per call, and tool fees, including retries and branching scenarios.

By StackCalcs · Updated · Sources checked

Map one complete run

An agent run can invoke the model repeatedly: plan, call a tool, inspect the result, revise, and answer. Count every model call in that sequence. The AI Agent Cost Calculator models that sequence step by step: each call re-sends the growing context, cached history is billed at the cached-input rate, retries add calls, and an optional per-run tool fee is added. Every listed model is priced on the same loop.

For a research agent that makes six model calls with a 2,500-token system prompt and tool definitions, a 500-token task, 1,000 tokens of tool results and 600 output tokens per call, enter 6 steps, 2500, 500, 1000, and 600. The sixth call then sends 2,500 + 500 + 5 × 1,600 = 11,000 tokens, nearly four times the first. If two calls use a $0.01 paid search, enter $0.02 as the per-run tool fee. The calculator shows the run step by step and multiplies by runs per day and active days for the monthly total.

Turn traces into realistic averages

Group successful production traces by task type. Record model calls, total input tokens, total output tokens, and paid tool charges for each trace. Use a median case for the baseline and a high percentile for the budget ceiling. Failed runs matter too: retries and abandoned branches still consume tokens.

For monthly planning, enter runs per day and active days; the calculator multiplies the run cost for you and also prices the same loop on every listed model.

Caching of earlier context and retries are modeled; reasoning tokens count as output. Session runtime, sandboxes, storage, search fees unless entered, taxes, and discounts are excluded. The calculator applies one average output and tool-result size to every step, so irregular workflows require separate scenarios.

FAQ

Is “agent steps” the same as user requests?

No. One user request may trigger several model calls. Use the calls visible in an execution trace.

How should I model retries?

Enter the share of extra calls from retries observed in traces; every step is multiplied by one plus that rate. Do not count only completed paths.

Official sources

Related calculators

Continue reading