Find out why Fortune 500 companies choose us as their software development partner. Explore Our Portfolio. Proven across 2700+ projects. Have a project idea to share with us? Let's talk.
Find out why Fortune 500 companies choose us as their software development partner. Explore Our Portfolio. Proven across 2700+ projects. Have a project idea to share with us? Let's talk.

What Does an AI Agent Really Cost to Run? A Cost-per-Successful-Task Model

  • AI/ML
  • Last Updated: September 24, 2026
Let AI summarize this article instantly

Most AI agent budgets are built on one number, the provider’s price per million tokens, and most of them are wrong by an order of magnitude. Token price describes what one model call costs. It says nothing about how many calls an agent makes per task, how much context it resends on each call, how often it fails, or who cleans up when it does.

We built a cost model for three common agent workloads to see what actually drives the bill. The finding was consistent across all three: the per-call price understated the true unit cost by 19 to 72 times, and in two of the three workloads, model tokens were less than a quarter of the total. This article walks through the model, the math, and the levers that matter, so you can budget an agent before it reaches production rather than after the first invoice.

Key takeaways

  • Measure cost per successful task, not cost per token. It is the only number that can be compared with what the work costs today.
  • Agents resend their context on every step. Billed input tokens grow roughly with the square of the number of steps, so loop depth matters more than most teams expect.
  • Success rate is usually the biggest lever. In our support model, raising the agent's resolution rate from 78% to 88% cut cost per task by 37%. Halving the token price cut it by 5.5%.
  • Caching is decisive for long-running agents. Without it, our 24-step operations agent cost 73% more per successful task.

Why price per token is the wrong starting number

A provider price sheet answers a narrow question: what does it cost to send a given number of tokens to a model and receive a given number back? An agent is not one call. A single customer request can trigger a planning call, several tool calls whose results are fed back into the model, a verification pass, and a final response, with the full conversation history attached to each request.

Three properties of agent workloads make per-token thinking misleading.

Calls multiply. Every step in an agent loop is a separate billed request. A six-step task is at least six calls, plus any guardrail or routing calls made by smaller models alongside it.

Context accumulates. Language model APIs are stateless. To continue a task, the agent sends the system prompt, the tool definitions, the user request, and everything that has happened so far, again, on every step. Tool definitions alone can run to thousands of tokens, and they are billed as input on each call.

Failure has a price. An agent that resolves 80% of tasks has not eliminated 80% of the cost of the work. The other 20% still needs a person, often a more expensive one, and the agent’s spend on those failed attempts is not refunded.

There is also a pricing asymmetry worth knowing. Output tokens typically cost several times more than input tokens, and on models with extended reasoning, the reasoning tokens are billed as output even when the provider does not return the full reasoning text. An agent that “thinks” for 1,500 tokens before a 400-token action is paying output rates for 1,900 tokens.

The cost-per-successful-task formula

The metric we recommend is cost per successful task: the total spend attributable to a workflow divided by the number of tasks that reached a correct outcome.

Cost per successful task = (model spend on all attempts + human review and rescue + allocated platform cost) ÷ tasks completed correctly 

Each term hides decisions that change the result. 

Model spend on all attempts includes failed attempts and automatic retries, not only the runs that succeeded. It also includes secondary models used for routing, moderation, or validation.

Human review and rescue is the cost of people who check flagged outputs or take over tasks the agent could not finish. It is calculated as the share of tasks that need a person, multiplied by the loaded cost of that person’s time on one task.

Allocated platform cost covers what does not scale per call: hosting, vector storage, observability tooling, and the evaluation runs you should be doing before every prompt or model change. Divide the monthly total by monthly task volume.

Tasks completed correctly is the denominator, and it is where many cost reports quietly cheat. A task the agent completed incorrectly, without anyone noticing, is not a success. If you do not measure correctness, you cannot compute this number honestly, which is itself a useful signal about readiness for production.

How agent token usage actually grows

Consider an agent with a 4,000-token starting context that adds 1,500 tokens of history per step (its own output plus the tool result it receives). On step one it sends 4,000 input tokens. On step six it sends 11,500. Across the whole task it is billed for 46,500 input tokens, not the 4,000 a naive estimate would use.

The general shape is simple. If a task starts with a base context of B tokens and each step adds d tokens, the total billed input over n steps is:

Total input tokens = n × B + d × n × (n − 1) ÷ 2

The second term grows with the square of the step count. Doubling the number of steps roughly quadruples the history portion of the bill. This is why a long-horizon agent that runs for 24 steps can bill hundreds of thousands of input tokens for a task that produces a few pages of output.

token context

Prompt caching is the main countermeasure. Most major providers now bill cached input reads at a steep discount, commonly 50% to 90% below the standard input rate, and some charge a premium to write content into the cache. Because agent history is append-only, the unchanged prefix of each request can be served from cache and only the newest tokens are billed at full price. Whether your stack actually achieves this depends on keeping the prefix stable: reordering tool definitions, injecting timestamps near the top of the prompt, or rewriting earlier history breaks the cache match.

Three worked models

We modeled three archetypes that cover most agent deployments: a real-time support agent, a batch document processing pipeline with human review, and a long-running operations agent. The token prices below are illustrative assumptions for a mid-tier model and a larger reasoning-capable model. They are close to the range of current list prices but are not any provider’s quote, so replace them with your own rates before relying on the output.

AssumptionSupport resolution agentDocument processing pipelineOperations agent
Model tier and price per million tokens (input / output) Mid-tier, $3 / $15 Mid-tier, $3 / $15, batch processed at 50% off Larger reasoning model, $5 / $25 
Cached input price per million tokens $0.30 Not used $0.50 
Steps per task 6 1 extraction call plus 1 validation call 24 
Starting context and growth per step 4,000 tokens, plus 1,500 per step 3 page images at about 1,800 tokens each plus a 2,500-token schema 6,000 tokens, plus 2,000 per step 
Output per step 300 tokens 900 tokens of structured data 400 tokens plus 1,500 reasoning tokens 
Success without a person 78% 88% pass validation; 12% flagged for review 70% on first attempt, one automatic retry 
Cost of a person per affected task $4.00 to take over a conversation $1.20 to review a flagged document $25.00 for an analyst to finish the task 
Monthly platform, evaluation, and observability cost $1,800 across 20,000 tasks $800 across 40,000 documents $2,000 across 3,000 tasks 
Human-only baseline per task $5.00 $1.50 $25.00 

Model 1: support resolution agent

Each conversation runs six steps: understand the request, retrieve account data, check policy, act, confirm, and respond. The agent bills 46,500 input tokens and 1,800 output tokens per conversation. With the stable system prompt and tool definitions cached, model spend is about $0.12. A small guardrail model adds a tenth of a cent, and the platform allocation adds $0.09.

That puts the agent side at $0.21 per conversation. The 22% of conversations handed to a person add $0.88 on average. The cost per successful task is $1.09, and model tokens account for about 11% of it.

The lesson is uncomfortable for teams focused on model pricing. Moving to a model at half the price saves about six cents per conversation. Resolving ten more conversations in every hundred saves forty.

Model 2: document processing pipeline

Each document runs through one extraction call over three page images, followed by a validation pass on a small text model that checks totals, dates, and required fields. Because documents do not need an answer within seconds, both calls go through a batch interface, which major providers discount by around 50% in exchange for asynchronous processing.

Model spend is under two cents per document. Platform allocation adds two cents. The 12% of documents flagged for review add $0.14, so the cost per successful document is about $0.18, against a manual baseline of $1.50.

Here the dominant cost is review, at 78% of the total. The validation pass is therefore the most valuable component of the pipeline, because a tighter validator that flags fewer false positives cuts review volume directly. Halving the flag rate from 12% to 6% reduces cost per document by 39%.

Model 3: long-running operations agent

This agent handles multi-step internal work such as reconciling records across systems. It runs 24 steps on a larger model with extended reasoning. Each attempt bills 696,000 input tokens and 45,600 output tokens, of which 36,000 are reasoning tokens.

The caching strategy decides the economics. Without caching, one attempt costs $4.62 in model spend. Caching only the stable system prompt brings it to $4.10. Caching the full append-only history, so each step pays full price only for its new tokens, brings it to $1.72. Cache write premiums, where a provider charges them, add about six cents per attempt at these volumes and do not change the conclusion.

With a 70% first-attempt success rate and one automatic retry, the agent averages 1.3 attempts per task. The 9% of tasks that fail twice go to an analyst at $25. Cost per successful task is $5.16 with full history caching and $8.92 without it, against a human baseline of $25.

Cost per call vs cost per successful task

This is the comparison that most budgets skip. The per-call figure is what a quick estimate from a price sheet would produce. The cost per successful task is what the business actually pays. 

WorkloadAverage model cost per callCost per successful taskRatioHuman-only baseline
Support resolution agent$0.020$1.0955x$5.00
Document processing pipeline$0.010$0.1819x$1.50
Operations agent$0.072$5.1672x$25.00

Two conclusions follow. First, an agent can be far cheaper than the current process and still cost many times more than a per-call estimate suggests, so the estimate matters for budgeting even when the business case is strong. Second, the ratio grows with loop depth, which is why long-running agents are the ones most often under-budgeted.

where the money goes

Which levers actually move the bill

We changed one assumption at a time and recorded the effect on cost per successful task.

ChangeWorkloadEffect on cost per successful task
Agent resolution rate rises from 78% to 88%Support−37%
Cost of a human takeover rises from $4 to $6Support+40%
Steps per conversation rise from 6 to 9Support+11%
Token prices fall by 50%Support−5.5%
Review flag rate falls from 12% to 6%Documents−39%
Real-time calls instead of batchDocuments+11%
First-attempt success rises from 70% to 85%Operations−38%
History caching turned offOperations+73%
Steps fall from 24 to 12Operations−23%
Token prices fall by 50%Operations−22%
Reasoning tokens per step fall from 1,500 to 500Operations−15%

The ranking is stable across the three workloads. Success rate and human cost dominate. Architecture choices such as caching, batching, and loop depth come next. Token price, the number most teams negotiate first, has the smallest effect in short workflows and only a moderate one in long workflows. 

How to reduce cost per successful task

The order matters. Optimizing token spend before you can measure success rate usually saves little and sometimes lowers quality enough to raise the total.

  1. Instrument every task end to end. Log each model call with its token counts, cached tokens, reasoning tokens, and a shared task identifier, then record the task outcome: succeeded, escalated, retried, or failed.
  1. Establish a correctness check. Build an evaluation set from real tasks and score outcomes, not just whether the agent returned something. Without it, you cannot tell a cheaper configuration from a worse one.
  1. Raise the success rate on the most common failures. Review escalated tasks by cause. Missing tool access, ambiguous policies, and poor retrieval are usually cheaper to fix than model quality.
  1. Cap loop depth and detect loops. Set a maximum step count per task type and stop the agent when it repeats the same tool call with the same arguments.
  1. Make caching work. Keep system prompts, tool definitions, and history stable and at the start of the request, then confirm through billing data that cached token counts are what you expect.
  1. Route by difficulty. Send classification, extraction, and validation to smaller models, and reserve larger reasoning models for the steps that need them. Set reasoning effort per step rather than globally.
  1. Batch anything that can wait. Overnight reports, document backlogs, and evaluation runs rarely need real-time responses.
  1. Prune context. Summarize or drop tool results the agent no longer needs, and retrieve fewer, better documents rather than many marginal ones.

Budget controls that prevent runaway spend

An agent that loops on a confusing input can burn through a day’s budget in minutes. Controls belong in the orchestration layer, not in the prompt, because a model cannot be relied on to stop itself.

Per-task limits. Cap steps, total tokens, and elapsed time for each task type, and end the task with an escalation when any limit is reached.

Per-customer or per-tenant budgets. In multi-tenant products, one heavy user should not be able to consume the margin on everyone else. Meter spend per tenant and throttle or alert at a threshold.

Anomaly alerts. Alert on cost per task, not only total daily spend. A 3x jump in cost per task on stable volume usually means a prompt change broke caching or a tool started returning oversized results.

A kill switch. Keep the ability to pause autonomous actions and route all traffic to people without a deployment. It is cheap to build and expensive to lack.

Comparing against the human baseline

The business case rests on the comparison between cost per successful task and what the same outcome costs today. Build the baseline with the same care as the agent model: loaded hourly cost, handling time per task, and the share of tasks that already need a second touch.

Two adjustments keep the comparison honest. Include the cost of errors that neither the agent nor the reviewer catches, such as refunds, rework, or compliance exposure, on both sides. And account for the people who remain in the loop. In our support model, the human takeover rate is the single largest cost, which means the humans who stay are doing harder work. Their handling time per task may rise, and the baseline should reflect that.

What to measure from day one

Every production agent should report the following for each task type, weekly: task volume, success rate without human help, escalation rate by cause, average steps per task, input, cached, reasoning, and output tokens per task, model spend per task, human review cost per task, and cost per successful task. With those numbers in place, every change to prompts, models, or tools can be judged on the only metric that matters to the business.

Turn AI Agent Costs Into Business Metrics
From inference and infrastructure to retries and human intervention, model the full economics of your AI agent.
Start the Conversation

Frequently asked questions

How much does it cost to run an AI agent per month?

It depends on volume, loop depth, success rate, and how much human review remains. In our models, cost per successful task ranged from $0.18 for batch document processing to $5.16 for a 24-step operations agent. Multiply your expected cost per successful task by monthly volume, then add fixed platform costs if you have not already allocated them per task.

Why is my AI agent more expensive than the token price suggests?

Because the agent makes many calls per task and resends its growing context on each one. A task with a 4,000-token starting context can bill more than ten times that in input tokens over six steps. Retries, reasoning tokens billed as output, guardrail calls, and human takeovers add further cost that per-token estimates leave out.

Does prompt caching reduce AI agent costs?

Yes, often substantially. Cached input is billed at a large discount by most major providers. In our long-running operations model, caching the full conversation history reduced model spend per attempt from $4.62 to $1.72. Savings depend on keeping the start of each request stable, so verify cached token counts in billing data.

Should I use a cheaper model to reduce agent costs?

Only for steps where the cheaper model performs as well. If a cheaper model lowers the success rate, the added human takeovers usually cost more than the token savings. Routing simple steps to smaller models while keeping harder steps on a stronger model is generally safer than switching the whole agent.

Are reasoning tokens billed?

Yes. On models with extended reasoning, the reasoning tokens are billed as output tokens, even when the provider does not return the full reasoning text. Because output is priced higher than input, reasoning effort is one of the more direct cost controls available.

When is an AI agent cheaper than a human?

When its cost per successful task, including human review and rescue, falls below the loaded cost of the same outcome today. In all three of our models the agent was cheaper than the human-only baseline, by roughly 4.5 to 8 times, but the margin depended heavily on success rate and on the cost of the people who handle exceptions.

How do I stop an AI agent from running up costs?

Set hard limits outside the model: maximum steps, tokens, and time per task, per-tenant budgets, alerts on cost per task, and a way to pause autonomous actions instantly. Loop detection, which stops an agent repeating the same tool call, prevents the most common runaway pattern.

Found this post insightful? Don't forget to share it with your network!
  • facebbok
  • twitter
  • linkedin
  • pinterest
Patel Akash
Written by

Patel Akash is Head of Sales & Operations at MindInventory. He leads global growth, strategic partnerships, and digital transformation initiatives, working at the intersection of business strategy and technology execution to turn ambitious product ideas into scalable builds and the engineering teams that deliver them. His expertise spans AI, cloud, web, mobile, and enterprise technology. He writes about the practical side of enterprise tech, how companies actually adopt AI, what it takes to scale an engineering team, and where digital transformation efforts tend to stall. For founders and technology leaders who want signal over hype.