How do you calculate the cost per task completed by an AI agent?

To calculate the cost per task completed by an AI agent, divide the total cost of running the agent during a given period by the number of tasks it completed in that same period. The total cost includes API fees (typically token-based), compute resources, orchestration overhead, and any integration or tooling costs. This metric gives you a direct view of the unit economics behind your AI investment.

The exact figure varies significantly depending on the model you use, how efficiently your prompts are structured, and how complex each task is. For organizations managing AI at scale, tracking cost per completed task is one of the most useful AI agent cost metrics available because it connects spending directly to output rather than to usage volume.

Below, we break down each component of the calculation, walk through the formula, and explain how to benchmark and reduce this cost over time.

What inputs go into an AI agent’s cost per task?

The inputs that determine an AI agent’s cost per task fall into four main categories: model API costs, compute and infrastructure costs, orchestration and tooling overhead, and human-in-the-loop or review costs. Each task an agent completes draws from all four, though the proportion varies depending on your architecture and use case.

  • Model API costs: The fees charged by an LLM provider (such as OpenAI, Anthropic, or Google) based on the number of tokens processed in both the prompt and the response.
  • Compute and infrastructure costs: Server time, memory, and processing power consumed during task execution, particularly relevant if you run self-hosted models or complex agentic pipelines.
  • Orchestration overhead: The cost of the agent framework itself, including tool calls, retrieval-augmented generation (RAG) lookups, and multi-step reasoning loops that each consume additional API calls.
  • Human review and correction: If a human validates or corrects agent output before a task is marked complete, that labor cost should be factored in to get an accurate picture of total cost per completed task.

Missing any of these inputs leads to an underestimation of true AI agent cost. Organizations often focus only on API spend and overlook orchestration loops, which can multiply token usage significantly in agentic workflows.

What is the formula for calculating cost per task completed?

The formula for AI agent cost per task is straightforward: Cost per task = Total cost incurred / Number of tasks completed. Total cost includes all inputs described above, summed across a defined measurement period. Number of tasks refers only to tasks that reached a successful or accepted completion state, not tasks that were initiated or abandoned.

A more granular version of the formula breaks down total cost into its components:

  1. Calculate total token cost: (Input tokens used x input token price) + (Output tokens used x output token price)
  2. Add compute and infrastructure cost for the same period
  3. Add orchestration overhead (additional API calls from tool use, retries, and chained steps)
  4. Add any human review labor cost allocated to AI-assisted tasks
  5. Divide the sum by the number of successfully completed tasks

For example, if your agent processes 10,000 tasks in a month and your combined API, compute, and tooling costs total $2,000, your cost per completed task is $0.20. Tracking this figure consistently over time lets you measure the impact of optimizations and compare it against the value each completed task delivers to the business.

How do token usage and API pricing affect the calculation?

Token usage and API pricing are typically the largest drivers of AI agent cost per task, especially when using third-party LLM APIs. API providers price separately for input tokens (the prompt, context, and instructions sent to the model) and output tokens (the model’s response). Because agentic workflows often involve long system prompts, retrieved context, and multi-turn reasoning, token counts per task can be significantly higher than in simple single-turn interactions.

Several factors cause token usage to inflate beyond what you might expect:

  • Long system prompts: Detailed instructions passed at the start of every call add input tokens to every single task, regardless of task complexity.
  • Context window accumulation: In multi-step agents, previous conversation turns are often included in each subsequent call, causing token counts to grow as the task progresses.
  • Tool call responses: When an agent retrieves data from an external tool or database, the returned content is fed back into the context window as additional input tokens.
  • Retries and error handling: Failed steps that trigger re-attempts double or triple the token cost for that portion of the task.

Model choice also has a direct impact. Frontier models (such as GPT-4o or Claude Opus) deliver higher capability but cost significantly more per token than smaller, faster models. Routing simpler subtasks to a cheaper model while reserving the frontier model for reasoning-heavy steps is one of the most effective ways to reduce average cost per completed task without sacrificing quality.

What is a good benchmark for AI agent cost per task?

There is no universal benchmark for AI agent cost per task because the right figure depends entirely on the value the task delivers and the industry context. However, a useful framing is to compare cost per AI-completed task against the cost of the same task completed by a human or through a traditional automated process. If your AI agent costs $0.50 per task and the equivalent human effort costs $5.00, the economics are clearly favorable. If the gap is narrow or reversed, the case for AI deployment weakens.

That said, industry experience points to a few reference ranges worth knowing:

  • Simple, well-defined tasks (data extraction, classification, summarization) using efficient models: often under $0.05 per task
  • Moderate complexity tasks (multi-step research, document analysis, structured output generation): typically $0.10 to $0.50 per task
  • Complex agentic workflows with multiple tool calls, long context, and human review: can exceed $1.00 to $5.00 per task

The most important benchmark is your own trend line over time. A cost per task that decreases quarter over quarter as you optimize prompts, improve task completion rates, and refine your model selection strategy is a strong indicator of a maturing AI operation.

How does cost per task differ from cost per hour or cost per user?

Cost per task is an output-based metric, while cost per hour and cost per user are input-based or capacity-based metrics. The distinction matters because input-based metrics tell you what you spent but not what you got, making it harder to assess AI agent ROI directly.

Cost per hour measures how much it costs to run an AI agent for a unit of time. This is useful for infrastructure budgeting but tells you nothing about how productive that time was. An agent that completes 100 tasks in an hour and one that completes 10 tasks in the same hour have identical cost-per-hour figures but very different cost-per-task figures.

Cost per user, common in SaaS licensing models, reflects the price of access rather than the price of output. It is relevant for vendor contract management but does not capture operational efficiency or the actual volume of work delivered.

For organizations focused on IT cost optimization and value realization, cost per completed task is the superior metric because it ties spending directly to business output. It supports better investment decisions, clearer ROI conversations with leadership, and more meaningful comparisons between AI-assisted and traditional approaches.

How can organizations reduce AI agent cost per task over time?

Organizations can reduce AI agent cost per task through a combination of prompt optimization, model selection strategy, task completion rate improvement, and architectural efficiency. Each lever targets a different part of the cost equation, and the biggest gains typically come from addressing all of them systematically rather than optimizing one in isolation.

Optimize prompts and context management

Reducing unnecessary tokens in system prompts, trimming retrieved context to only what is relevant, and compressing conversation history all lower input token costs without affecting output quality. Even a 20% reduction in average tokens per task compounds significantly at scale. Prompt engineering is not a one-time activity but an ongoing discipline that pays back consistently.

Use model routing and tiered model selection

Not every subtask within an agentic workflow requires a frontier model. Routing classification steps, simple lookups, and formatting tasks to smaller, cheaper models while reserving high-capability models for complex reasoning can reduce average cost per task by a meaningful margin. This requires clear task decomposition and a routing layer in your agent architecture, but the cost savings justify the investment at any meaningful scale.

Improve task completion rates

Failed or incomplete tasks that consume tokens without producing a completed output inflate your cost per task significantly. Improving the reliability of your agent through better error handling, clearer task definitions, and more robust tool integrations reduces wasted spend and improves the denominator in your cost calculation.

Implement continuous cost monitoring

Without visibility into cost per task at a granular level, optimization is guesswork. Tagging API calls by task type, agent version, and business process allows you to identify which workflows are cost-inefficient and prioritize improvements where they will have the most impact. This is the same discipline that underpins cloud financial management, applied to AI workloads.

How we help you manage AI agent costs

As AI agents become a meaningful part of IT spend, managing their costs requires the same rigor you apply to cloud and on-premises infrastructure. We help organizations build that rigor through our FinOps services, extended to cover AI workload cost allocation, visibility, and optimization.

  • Cost allocation by workload: We help you tag and attribute AI API costs to specific business processes, teams, or products so you can see cost per task by use case rather than as an undifferentiated total.
  • Benchmarking and target-setting: We work with you to define what good looks like for your AI agent cost metrics, based on the value each task type delivers to the business.
  • Governance and decision cadence: We establish the review rhythms and accountability structures that ensure AI cost data drives actual decisions rather than sitting in dashboards that no one acts on.
  • Integration with TBM: Through our strategic portfolio management approach, we connect AI investment costs to business outcomes, so leadership can evaluate AI agent ROI in the same framework as any other technology investment.

If you want to move from tracking AI costs to actively managing them, get in touch with us and we will show you where to start.

It's Value
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.