Business & Ecommerce calculator

AI Agent Cost per Successful Task Calculator

Token cost is not task cost. Task cost is not successful-task cost. An agent may call several models, use external tools, retry failed steps, and require human review before one task is truly completed — this calculator combines those costs into one operational estimate, in your browser.

Cost per success Retries Model routing Caching Scenarios XLSX

Educational operating-cost estimate — not a guaranteed bill, and not investment, procurement, or employment advice.

This calculator is built from documented pricing inputs and transparent operational assumptions — see Sources below.

Your entries are calculated in your browser and never sent to Calculator Matters. Do not enter API keys, confidential prompts, or sensitive customer data.

Workload & success

per 1M tokens
per 1M tokens
%

The chance ONE attempt succeeds — not the chance the task ever succeeds.

$
$
$

Illustrative starting point — replace every assumption with your own workflow data. Switch to Advanced agent model for multi-model stacks, prompt-caching detail, agent trajectories, and scenario comparison.

Cost per successful task

$0.1430

This workflow is estimated to spend $0.1430 for each successfully completed task, after accounting for failed runs, retries, tools, and human review.

Expected monthly AI-agent cost

$1,407.38

Fully loaded — API, tools, human ops, and fixed/amortised cost.

Expected successful tasks / month

9,844

Out of 10,000 incoming.

Success within retry cap

98.4%

First-attempt success: 75.0%

Failed / wasted spend

$16.78

1.2% of total monthly spend.

Human-operations cost

$787.50

Review, rework, escalation, and maintenance.

Cost per incoming task

$0.1407

Includes tasks that never succeeded.

Secondary results
First-attempt cost per task$0.0358
Expected attempts per task1.31
Monthly model + tool cost$469.88
Monthly tool cost$131.25
Monthly fixed cost$150.00
Operating-only cost (excl. amortisation)$1,407.38
Fully loaded annual cost$16,888.50
Cost without caching$0.0258
Caching savings (per attempt)$0.000

Monthly cost composition

  • Model tokens24%
  • Tools9%
  • Human review & rework56%
  • Fixed / infrastructure11%

Retry economics

Expected attempts and cost by attempt number
AttemptApprox. probability reachedCost contribution
Attempt 1100% of tasks$358.00
Retries (2–3)0.31 expected retry attempts / task$111.88
Permanently failed1.6%$16.78

Cost-reduction insights

  • Retries account for approximately 24% of your monthly model and tool spend.
  • Human-operations cost ($787.50) exceeds model and tool spend ($469.88) at your current settings.

Every insight above is generated directly from the values you entered — none of these are universal recommendations.

Monthly cost composition

The results panel breaks total monthly cost into model tokens, tools, human review and escalation, ongoing maintenance, fixed infrastructure, and amortised implementation cost. Nothing is hidden inside a single blended number — each segment is shown as its own share of the total, with a text legend so the chart works without relying on colour alone.

Retry and success analysis

The retry-economics table shows how monthly cost splits across the first attempt, the retries that follow, and the tasks that permanently fail after exhausting every retry. A task that never succeeds still costs money — this calculator reports that as wasted spend rather than folding it silently into an average.

Three figures matter more than any single average: first-attempt success rate (the chance one attempt works), success within your retry cap (the chance the task eventually succeeds at all), and expected attempts per task (how many attempts, on average, one incoming task actually consumes).

Cost-reduction opportunities

The Cost-reduction insights panel above is generated directly from your own inputs — nothing there is a generic recommendation. Depending on what you enter, it may point out that retries dominate spend, that fixed costs are too large for your current volume, that a verifier model costs more than the model it is checking, or that your cache-hit rate has little effect because too little of your input is actually cacheable.

Common levers worth testing in the calculator itself: improving first-attempt success, reducing unnecessary context growth, increasing valid cache reuse, routing simpler tasks to a cheaper model, cutting unneeded verifier calls, reducing tool-call frequency, batching eligible requests, shortening output length, and compacting context safely in long agent runs.

How the calculation works

Every figure on this page is produced by a documented formula — nothing is hidden inside a tooltip.

Model call cost

For each model call: uncached input cost = uncached input tokens ÷ 1,000,000 × input price. Cached-read cost = cached tokens ÷ 1,000,000 × cached-input price. Cache-write cost = newly cached tokens ÷ 1,000,000 × cache-write price. Output cost = output tokens ÷ 1,000,000 × output price. Model cost is the sum of all four, plus any flat per-call cost. Batch discounts apply only to the token-priced components.

Expected attempts and success within the retry cap

Let p be the per-attempt success probability and M = 1 + maximum retries. Then success within the retry cap = 1 − (1 − p)M, and the expected number of attempts one incoming task consumes = (success within the retry cap) ÷ p. At p = 0 this is handled as the explicit limit M (every attempt is used and none succeed); at p = 1 it is handled as the explicit limit 1 (the first attempt always succeeds) — neither case divides by zero.

Cost per incoming task and cost per successful task

Total monthly cost = model + tool cost + human-operations cost + monthly fixed/subscription cost + amortised implementation cost. Cost per incoming task = total monthly cost ÷ incoming monthly tasks. Cost per successful task = total monthly cost ÷ expected monthly successful tasks. When there are zero incoming tasks or zero expected successes, the calculator shows “Not calculable” rather than Infinity, NaN, or a misleading zero.

Human-review and amortised implementation cost

Review cost = reviewed successful tasks × review minutes ÷ 60 × loaded hourly cost. Escalation cost follows the same shape for failed tasks that get human attention. Amortised implementation cost = total one-time implementation cost ÷ amortisation period in months.

Break-even task volume against an existing process

When a human-led or existing-software baseline is entered, break-even monthly task volume solves for the point where the AI workflow’s fixed-plus-variable cost equals the existing process’s fixed-plus-variable cost — shown as a task count, not a vague statement that “it depends on scale.”

Worked example (illustrative)

Illustrative example — replace every assumption with your own workflow data. These are not industry averages.

A customer-support research agent processes 5,000 tasks a month. Each attempt uses a primary model (2,000 input tokens, 600 output tokens, 1 call) and a verifier model (1,500 input tokens, 100 output tokens, 1 call). 50% of input tokens are structurally cache-eligible, with an 80% cache-hit rate. A web-search tool fires once per attempt at $0.01/call. The per-attempt success rate is 75%, with up to 1 retry allowed (M = 2, retry cost multiplier 1.1×). 20% of successful outputs get a 4-minute human review at a $28/hour loaded rate, and 50% of failed tasks are escalated for a 6-minute human look at $22/hour, recovering 30% of them. Fixed monthly infrastructure (orchestration $49 + hosting $25 = $74/month), plus an $8,000 one-time build cost ($6,000 development + $2,000 integration) amortised over 12 months (≈$667/month).

Success within the retry cap: 1 − (1 − 0.75)2 = 1 − 0.0625 = 93.75%. Expected attempts per task: 0.9375 ÷ 0.75 = 1.25. Expected successful tasks: 5,000 × 0.9375 ≈ 4,688/month.

Combining the model-stack cost per attempt (with caching applied), the tool cost, the retry-weighted variable cost, human-operations cost, and the fixed-plus-amortised cost gives a total monthly cost that — divided by roughly 9,840 successful tasks — produces the cost-per-successful-task figure shown live in the calculator when you load these same numbers. Because every input above is reproduced exactly in scripts/validate-ai-agent-cost.mjs’s Scenario C fixture, the arithmetic behind this example is independently verified, not just asserted.

Interpretation guidance

Read cost per successful task as the number that matters for budgeting — it already accounts for every attempt a task needed, successful or not. Read cost per incoming task as a lower, more optimistic number that spreads cost across everything you attempted, including permanent failures. The gap between the two tells you how expensive unreliability actually is.

A high wasted-spend percentage means a meaningful share of spend is going to tasks that never succeeded — worth investigating before adding more retries or a pricier fallback model. A human-operations cost that rivals or exceeds model cost is common for agents with meaningful review requirements, and is not a sign of a badly built agent by itself.

Common AI-agent costing mistakes

  • Counting only output tokens. Input tokens — especially repeated context in multi-step agents — are frequently the larger share of cost.
  • Ignoring repeated context. A flat per-call average hides how much a long agent run grows in size step over step; trajectory mode exists specifically for this.
  • Assuming all attempts succeed. A single-attempt cost is not the cost of a completed task the moment your success rate is below 100%.
  • Treating retry cost as zero. Retries consume real model and tool calls, whether or not they ultimately succeed.
  • Ignoring tool-call charges. Search, retrieval, browsing, and code-execution calls often add up to a meaningful share of variable cost.
  • Ignoring human review. If a person genuinely checks or fixes outputs before they count as done, that labour is part of the real cost.
  • Ignoring fixed infrastructure. Orchestration, hosting, observability, and evaluation platforms cost money every month regardless of usage.
  • Using outdated model prices. Provider pricing changes; a number from months ago can materially understate or overstate current cost.
  • Assuming every cached token receives a discount. Only the structurally-eligible share of input is ever cacheable, and not every eligible token gets a cache hit.
  • Comparing cost without comparing quality. A cheaper workflow that fails more often, or produces worse output, is not simply “better.”
  • Dividing spend by attempted tasks instead of successful tasks. This is the single most common error this calculator is built to correct.
  • Assuming higher token use guarantees a better result. Longer prompts and more calls raise cost without necessarily raising success rate.
  • Treating an average as a guaranteed bill. Every figure here is a planning estimate from the assumptions you entered, not a forecast of your actual invoice.

Limitations

This calculator does not fetch live provider pricing, does not see your actual API usage, and cannot predict real-world success rates, latency, or output quality. It cannot certify security, compliance, or safety. Prompt-caching behaviour in particular depends on provider-specific rules, prompt structure, cache lifetime, and request similarity that this model only approximates. Self-hosted compute costs are modelled at a basic level (effective cost per attempt from GPU cost, count, and utilisation) and do not capture the full complexity of production infrastructure. Treat every result as a planning estimate to test against real usage data, not a substitute for monitoring your actual bill.

Sources and methodology

Formula: the retry-probability, expected-attempts, and cost-allocation formulas above are standard probability and cost-accounting identities, verified independently in this site’s automated test suite against hand-computed fixtures — not invented for this page.

Model pricing presets: copied only from official provider pricing documentation, never a third-party aggregator, with the source URL and verification date recorded for each. Model prices change — verify current rates with the provider before making a purchasing decision.

Related calculators

Frequently asked questions

How do I calculate the cost of an AI agent?

Add up every model call in one attempt (input, output, and cached tokens at their published rates), add tool and infrastructure costs for that attempt, then account for how many attempts one incoming task actually needs once retries and failures are included. The result — total monthly cost divided by expected successful tasks — is the number that matters, not a single API call’s price.

What is cost per successful AI task?

It is total monthly cost (model calls, tools, retries, human review, and fixed/infrastructure cost) divided by the number of tasks expected to actually succeed within your retry cap in a month. It is always equal to or higher than cost per attempt, because failed attempts and retries are folded into the successful tasks that remain.

Why is AI-agent cost higher than token cost?

Token cost only covers one model call. A real agent task typically involves multiple model calls (router, worker, verifier), tool calls, a chance of failing and retrying, and sometimes human review before it is genuinely done. Each of those adds cost that a simple token calculation never sees.

How do retries affect AI-agent cost?

Every retry is an additional attempt, and additional attempts cost money whether or not they ultimately succeed. A workflow with a 60% per-attempt success rate and two retries spends noticeably more per task than the same workflow at 90% success, even though the model price never changed — see the Retry & success analysis section on this page for the exact formula.

How should failed AI-agent runs be counted?

Separately from successful ones. A task that exhausts every retry and still fails is a real cost with zero successful output to show for it. This calculator reports that cost explicitly as wasted spend, rather than quietly averaging it into a single blended number.

How does prompt caching reduce cost?

Providers charge a fraction of the standard input price for tokens read from a prompt cache. It only helps for the share of your input that is actually eligible (usually a system prompt or repeated context) and actually gets reused — assuming every token is cacheable, or that every cache lookup hits, will overstate the savings.

Should human review be included in AI cost?

Yes, whenever a human genuinely reviews, reworks, or escalates a task before it counts as done. Presenting only the API bill as “the cost of AI” understates the real number for most production agents, which is why this calculator has a dedicated human-operations section rather than treating it as an afterthought.

How do I compare two AI models for an agent workflow?

Compare them on cost per successful task for your actual workflow, not list price per token. A cheaper model with a lower success rate or a higher retry rate can end up costing more per successful task than a pricier model that gets it right the first time — use the Scenario Comparison to test this directly with your own numbers.

What is the difference between cost per attempt and cost per successful task?

Cost per attempt is the price of one pass through the agent, win or lose. Cost per successful task divides ALL monthly cost — including failed attempts and retries — by only the tasks that actually succeeded. The two numbers are the same only when every attempt succeeds on the first try.

How often should model prices be updated?

Check before every significant budgeting decision. Provider pricing changes without much notice, and this calculator’s presets carry a verification date for exactly that reason — see the Sources section below for when each preset was last checked against the provider’s own pricing page.

Can this calculator estimate self-hosted AI costs?

Yes, at a basic level: enter your effective per-attempt compute cost (GPU cost per hour ÷ effective throughput, accounting for utilisation) as a custom model’s “other cost per call.” Low utilisation materially increases the real per-task cost of self-hosted infrastructure — never assume 100% utilisation when doing this.

Does a cheaper model always produce a cheaper successful task?

No. A lower per-token price can be offset by a lower success rate, more retries, larger context needs, or more human review — all of which raise cost per successful task independently of the token price. This is exactly why the calculator measures cost per successful task rather than stopping at cost per call.

Educational disclaimer

This calculator provides an educational operating-cost estimate based on the assumptions and pricing values entered. Actual AI-provider bills, token use, cache behaviour, tool charges, reliability, latency, quality, and human-review requirements may differ. Verify current provider pricing and test the workflow with production data before making financial, technical, or procurement decisions. This is not investment, employment, legal, or security-certification advice, and does not guarantee savings or performance.

Built from documented pricing inputs and transparent operational assumptions · How we calculate · email us

Authorship & verification

Written and maintained by

  • Formula and examples verified on 16 July 2026
  • Educational estimate only

Add this calculator to your site

Responsive embed — and private: nothing your visitors type leaves their browser.