AI Agent Cost Calculator

Agent workflow

One step is one model call. Monthly tasks count original tasks, before step retries.

Include tasks that ultimately fail. Do not add step retries here.

Planned model calls in one complete workflow, from 1 to 200.

System prompt, tool schemas, user task and initial retrieved content.

Net history kept for the next call, including previous output and tool results. Zero means fixed-size context.

Average billed output for each attempt, including billable reasoning tokens.

Retries and success

Retries repeat a step, including its paid tools. Final task success is a separate business outcome.

Chance an attempt requires another try, until the retry limit is reached.

Additional attempts after the first. Zero disables retries; maximum 20.

Share of original tasks that meet your success criteria after retries.

Prices and tool fees

All prices are USD. Token rates are per 1 million tokens; replace the example prices with your own rates.

Price for input not served from cache. Use a blended rate if needed.

Price for a cached input token, not a percentage discount.

Price for generated tokens, including charged reasoning output.

Effective share of all input tokens billed as cache reads, including cold starts and expiry.

Average paid calls in each step attempt. Fractions are allowed; zero means no paid tools.

Weighted average fee for search, scraping, execution or other paid tools.

Hosting, subscriptions, cache-write/storage charges or other monthly overhead. Not multiplied by retries.

Estimated monthly total (USD)
$1,194.36
Variable cost per started task
$0.119436
Cost per successful task
$0.132707
Expected successes per month
9,000

Monthly cost breakdown

Uncached input · first attempts
$440.00
Cached input · first attempts
$44.00
Output · first attempts
$192.00
Tool fees · first attempts
$400.00
All extra retry costs
$118.36
Other monthly costs
$0.00

Retry costs include extra input, output and tool fees. They are separate from first attempts to avoid double counting. Displayed amounts are rounded.

Expected model calls per month
88,800
Input tokens per month
488,400,000
Output tokens per month
26,640,000
Monthly savings from cache reads
$439.56
Expected attempts per step
1.11
Step-by-step context and cost

Input is for the first attempt of each step. Costs include expected retries and tools, but exclude monthly overhead.

Step-by-step context and cost
StepInput tokensStep cost (USD)Running total (USD)
12,000$0.010656$0.010656
23,000$0.011877$0.022533
34,000$0.013098$0.035631
45,000$0.014319$0.04995
56,000$0.01554$0.06549
67,000$0.016761$0.082251
78,000$0.017982$0.100233
89,000$0.019203$0.119436

Example prices are illustrative, not a live model rate card. Results are planning estimates in USD.

Every task is budgeted for all steps, even if it fails. Retries use the same context and repeat tool fees. Cache misses use the regular input rate. Add cache-write/storage charges to other costs; tiered pricing, taxes and early stops are not inferred.

How it works

Enter monthly task volume and the number of model calls in a workflow. Estimate the first prompt and the history retained after each step, then set retry limits and final task success. Add your input, cache-read and output rates, paid tool fees and monthly overhead. The estimate updates as you type; expand the step table to see how context accumulates.

Example

With the example inputs, 8 steps consume 44,000 input tokens before retries. A 10% retry probability and at most 2 retries give 1.11 expected attempts per step. At 10,000 tasks per month, the total is $1,194.36. With 90% final success, 9,000 successful tasks cost about $0.132707 each, including failed work.

Frequently asked questions

Why do more steps increase input costs so quickly?

Retained history is sent again on later calls. Each step adds context, so total input grows quadratically with step count when history grows by a constant amount. Context growth already includes retained output and tool results; the calculator does not add them twice. Set growth to zero for fixed-size context, and budget any summarization calls separately.

How are retries, caching and successful tasks modeled?

Retries are capped extra attempts at each step, with the same token and tool costs. Final business success is entered separately. Cost per success divides the entire monthly bill, including failed tasks and overhead, by expected successes. Cache share is an effective share of billed input, not an automatic guarantee that a prompt is eligible for caching. Use measured usage and your provider's rates for a closer estimate.

Calculation method

I=NB+GN(N−1)2,A=∑k=0RpkI=NB+\frac{GN(N-1)}{2},\qquad A=\sum_{k=0}^{R}p^k

I is input tokens per task before retries; N is steps; B is first-step input; G is retained context added per step. A is expected attempts per step, p is retry probability as a fraction, and R is the maximum retries. Variable task cost sums input, output and tools, multiplied by A. Monthly total adds fixed costs; cost per success divides that total by expected successful tasks.