AI Agent Cost per Task Calculator

The AI Agent Cost per Task Calculator combines model token prices, tool charges, infrastructure cost, and retry overhead into one per-task estimate. It keeps input and output tokens separate because they are commonly priced at different rates and shows the projected workload spend.

Use it to compare agent designs, set unit-economics targets, or evaluate whether reducing context, model turns, or paid tool usage has the largest financial effect. Prices should be entered from the applicable provider and contract because rates and billing categories vary.

Inputs

tasks
tokens
tokens
$
$
$
$
%
Result
Estimated cost per task
Model cost per attempt
Tool + infrastructure
Total workload cost
Retry overhead per task

1. Enter task volume
Set the number of completed tasks in the forecast period.

2. Add token usage
Use average input and output tokens for one task attempt.

3. Enter current model prices
Provide prices per one million tokens for the selected model.

4. Include non-model charges
Add paid search, browser, database, GPU, or other per-task costs.

5. Account for retries
Use retry rate for repeated attempts and review both unit and total cost.

Model cost per attempt = Input tokens ÷ 1,000,000 × Input price + Output tokens ÷ 1,000,000 × Output price
Cost per task = (Model cost per attempt + Tool cost + Infrastructure cost) × (1 + Retry rate ÷ 100)
Workload cost = Cost per task × Number of tasks

What the result means

The result estimates average variable cost for one completed task after retry overhead.

Add fixed engineering, storage, support, taxes, and minimum commitments separately when evaluating full product economics.

Given: 20,000 tasks, 4,000 input tokens at $2.50 per million, 800 output tokens at $10 per million, $0.012 tool cost, $0.004 infrastructure cost, and 5% retries.

Calculation: Model cost = (4,000 ÷ 1,000,000 × $2.50) + (800 ÷ 1,000,000 × $10) = $0.018. Base cost = $0.018 + $0.012 + $0.004 = $0.034. Adjusted cost = $0.034 × 1.05 = $0.0357.

Result: Cost per completed task is about $0.0357 and total workload cost is $714.

Where do cached-token prices go?

Calculate cached and uncached input portions separately, then combine them into an effective input cost per task before entering it.

Should tool cost include free calls?

Use the average paid tool cost across all tasks, including tasks that incur no charge.

How do I include a monthly server bill?

Divide the allocable monthly bill by expected monthly tasks and enter that amount as infrastructure cost per task.

Why can the result differ from an invoice?

Providers may round usage, apply tiers, charge for reasoning tokens, or use separate cache and batch rates.

What is the best comparison metric?

Compare cost per successful task together with task quality and latency, rather than choosing the cheapest model call in isolation.