AI agent cost per successful task is the total spend on every attempt divided by the tasks that actually passed your acceptance test. It includes model tokens, tool calls, retrieval, execution, retries, monitoring, and human review, which is why it is rarely close to the token price. A workflow at 60% first-pass success costs 1.67 times its per-attempt price before a single human minute is counted.

This page is a worksheet for that number. It prices one agent step for seven models at list rates read on 2026-08-29, shows how success rate reorders them, and compares the result with a person doing the same task. The short version: against a $30 per hour human taking six minutes, the model layer is roughly 3% of the cost, and review minutes and retries decide how large the agent's advantage really is. The worksheet answers four questions: whether the workflow has a viable cost per outcome, whether retries or tool calls drive the waste, what belongs in a monthly forecast, and which control to change before switching models.

No dollar figure on this page comes from a real agent bill. Keep these kinds of numbers apart when you reuse them:

Number typeExamples on this pageWhere it comes from
Published list pricesModel token rates, $10 per 1,000 web searches, $0.08 per session-hourAnthropic and OpenAI pricing pages; model rates read on 2026-08-29
Stated assumptions8,000 input and 800 output tokens per attempt; 95%, 80%, and 60% success; a $30 per hour person taking six minutesPlanning inputs, not measurements
Illustrative scenarios100 attempts, 25 retries, and 80 successes; the worksheet example column; the three monthly plansExample workloads that show the arithmetic
Observed spendNoneReplace the scenarios with your provider usage records and invoices

What counts in AI agent cost?

An AI agent is a software workflow that uses a model to choose steps, call tools, inspect results, and continue until it reaches a stopping condition. The model is one cost layer. A browser session, database lookup, sandbox, search request, or approval queue can add cost around it.

Separate variable costs from fixed costs before comparing vendors. Variable costs scale with work; fixed costs exist even when the agent is idle. Mixing them makes a small test look expensive or a high-volume deployment look cheap.

Cost layerTypical unitWhat makes it grow
Model inferenceInput, cached input, reasoning, and output tokensLong context, verbose answers, repeated loops
ToolsSearch, API, transaction, browser, or code callMore steps, failed calls, large results
Retrieval and memoryEmbeddings, vector search, storage, database readsLarge collections and frequent refreshes
ExecutionContainer, browser, sandbox, or GPU time (see GPU cost per million tokens)Long-running tasks and concurrency
Review and supportHuman minutes, evaluation, incidentsLow confidence, risky actions, edge cases
Fixed operationsPlatform, logging, backups, engineeringProduction requirements and retention

Provider pricing pages expose different pieces of this stack. Anthropic's pricing page separates input, cache writes, cache hits, and output. Google's Gemini pricing separates input, output, context caching, and storage. The worksheet keeps those units visible instead of pretending one token rate represents the whole product. When you estimate latency cost, record model time, tool wait time, timeout retries, and review minutes beside token spend.

The AI agent cost per successful task formula

Use this formula for an outcome that has a clear pass or fail state:

Cost per successful task = total cost of all attempts ÷ successful tasks

Total cost includes every attempt, including attempts that time out, call the wrong tool, exceed a token limit, or reach a human. Successful tasks are the runs that meet your acceptance test without hidden correction work. Report the time window, workload, model mix, and success definition beside the result. NVIDIA's inference TCO method makes the related point that usage, latency, throughput, and input/output mix all affect the allocated cost of an inference workflow.

The worked example uses a published rate instead of arbitrary dollar values. Suppose a month contains 100 initial attempts and 25 retry attempts, all using Claude Haiku 4.5 with the 8,000-input, 800-output token shape used in the next section. Anthropic lists that model at $1 per million input tokens and $5 per million output tokens, so one attempt costs $0.0120. The example covers model tokens only.

ComponentCalculationCost
Initial model attempts100 × $0.0120$1.20
Retry model attempts25 × $0.0120$0.30
Model-token total$1.20 + $0.30$1.50
Successful tasks80-
Cost per successful task$1.50 ÷ 80$0.0188

That is a reproducible calculation from a published rate and an explicit token shape, not a provider bill. Add tool calls, runtime, retrieval, support, and review from measured records before using the result as a budget.

AI agent cost by model at current list prices

The table below prices one agent step at list rates from Anthropic and OpenAI's pricing page, read on 2026-08-29, holding the task shape constant at 8,000 input tokens and 800 output tokens. That shape is an assumption meant to cover a system prompt, tool definitions, retrieved context, and a short structured answer. The last three columns divide the per-attempt cost by first-pass success rate, because the same model costs a different amount depending on how often it finishes the job.

ModelInput $/MTokOutput $/MTokPer attemptPer success at 95%at 80%at 60%
gpt-5-nano$0.05$0.40$0.0007$0.0008$0.0009$0.0012
gpt-5-mini$0.25$2.00$0.0036$0.0038$0.0045$0.0060
Claude Haiku 4.5$1.00$5.00$0.0120$0.0126$0.0150$0.0200
gpt-5$1.25$10.00$0.0180$0.0189$0.0225$0.0300
Claude Sonnet 5$2.00$10.00$0.0240$0.0253$0.0300$0.0400
gpt-5.4$2.50$15.00$0.0320$0.0337$0.0400$0.0533
Claude Opus 5$5.00$25.00$0.0600$0.0632$0.0750$0.1000

Read the table across, not down. Claude Haiku 4.5 at 60% success costs $0.0200 per completed task, more than gpt-5 at 95% success costs at $0.0189, even though gpt-5's headline input price is 25% higher. A cheaper model that fails more often is not a cheaper model, so you need the success rate on your own acceptance test before the price column means anything.

Two costs sit outside the token table and are easy to forget. Server-side tools bill separately: Anthropic charges $10 per 1,000 web searches, or $0.01 per search, on top of the tokens the results consume. Managed agent runtimes add a time charge: Claude Managed Agents meters session runtime at $0.08 per session-hour while a session is actively running. An agent that makes three searches per task adds $0.03, which exceeds the entire model cost of every row above gpt-5.

AI agent cost calculator worksheet

Start with a ledger that records one row per task or one aggregate row per fixed workload. Do not estimate success rate from a few impressive demos. Use a defined acceptance test, such as a valid JSON result, a correctly updated record, or a human-approved answer. The example column below is illustrative; fill it from your own records.

InputExampleHow to capture it
Initial attempts100Count task IDs entering the workflow
Retry attempts25Count every additional model or tool cycle
Successful tasks80Apply the acceptance test after the final step
Input tokens2.0 millionProvider usage response
Output tokens0.4 millionProvider usage response
Cached tokens0.8 millionProvider cache usage fields
Tool and API spend$1.20Vendor invoices or request logs
Execution and storage$0.80Container, browser, GPU, and database bills
Review minutes40Approval and correction records
Review rate$0.10/minuteLoaded internal cost assumption

Store input, output, and cached usage as separate fields. OpenAI exposes cached-token usage in the response, and Langfuse supports separate usage and cost details for input, output, cached tokens, and other usage types. Inferred prices are useful, but provider-reported usage and cost should win when both exist.

Add a stop_reason and a task_status field. Useful statuses include completed, corrected, escalated, timed_out, and failed. Those fields show whether a cheap model is creating expensive downstream work.

AI agent cost per month: three planning scenarios

Monthly forecasting starts with successful tasks, not raw requests. Multiply the cost per successful task by the number of outcomes you need, then add fixed platform and operations costs. Keep peak demand, uptime, and fixed infrastructure separate from per-task usage so the forecast does not hide idle capacity.

Monthly planSuccessful tasksCost per successful taskFixed operationsIllustrative monthly cost
Pilot1,000$0.08$120$200
Team workflow5,000$0.12$300$900
Customer-facing20,000$0.18$900$4,500

These are planning examples, not predictions or observed spend. The higher unit cost in the last row models a tool-heavy workflow with more review and support. A measured result may fall as utilization improves, or rise when concurrency creates queueing and more retries.

Keep three forecasts beside each other: normal volume, a 3× spike, and a degraded-quality month. The degraded case matters because a provider outage, a changed tool schema, or a larger context can increase attempts without increasing successful outcomes. NVIDIA's TCO method likewise treats throughput, latency, peak demand, uptime, and input/output mix as cost inputs rather than optional details.

AI agent cost optimization that protects success rate

The best optimization removes waste while keeping the acceptance test intact. Start with the largest measured cost bucket; provider usage data that splits cached input from output makes it easier to test whether a prompt or model change actually lowers spend.

  • Budgets: cap steps, tokens, elapsed time, and spend per task. Stop the run or request approval when a limit is reached.
  • Routing: send classification, extraction, and simple tool selection to a lower-cost model, and reserve a stronger model for ambiguous or high-risk cases.
  • Caching: keep stable instructions and tool schemas at the start of the prompt, and cache repeated context when the provider's terms make reuse profitable. Run the prompt caching cost reduction break-even before assuming a cache pays for itself.
  • Tool output: limit it. A search response that returns ten pages of irrelevant text can cost more in follow-up tokens than the search request itself.
  • Retries: track them by reason. A retry caused by malformed JSON needs a different fix from a retry caused by a slow external API.
  • Review: sample by risk and confidence. Review every payment action, but sample low-risk read-only tasks.

Langfuse notes that usage buckets must be mutually exclusive. If a provider reports inclusive input tokens plus cached tokens, subtract the cached portion before storing the ordinary input bucket, or your cost report can count the same tokens twice.

When is an AI agent cheaper than a human?

Compare the agent with the fully loaded human cost for the same accepted outcome. A useful human baseline includes wage, benefits, management, software, waiting time, correction work, and the percentage of tasks that need escalation.

For a quick test, take an explicit planning assumption: a person costing $30 per hour and taking six minutes has a $3.00 variable baseline. Against the model table, even Claude Opus 5 at 60% success costs $0.1000 per completed task, so the model layer is roughly 3% of that baseline. The comparison is almost never lost on tokens.

It is lost on the layers around them. Add three web searches per task at $0.01 each, a quarter-hour of managed session runtime at $0.08 per hour, and one human review minute at the same $30 per hour loaded rate, and the agent's cost per accepted task moves from $0.1000 to roughly $0.65. Against the $3.00 human baseline that is still a win, but a 4.6x margin rather than the 30x the token price implied, and a second review minute per task takes it to $1.15 and a 2.6x margin. Model choice moves cents; review rate and retry rate move dollars.

That is why I would not call an agent profitable because its token bill is small. It is profitable when the value of the accepted outcome exceeds model, tools, infrastructure, review, support, and allocated build cost. Retool's discussion of hybrid human and AI workflows reaches the same practical point: the economic unit should reflect completed work, not an isolated API call.

References