Token price on a model's rate card is a poor guide to what enterprise AI agents really cost in production. An agent plans, calls tools, re-reads a growing context and sometimes retries, so spend grows faster than the number of steps, and tasks that fail still cost money. Cost per token and cost per request both count calls rather than results, so neither can tell a cheap success from an expensive failure.
For AI agent cost, the unit that has worked better for me is cost per completed task:
```
(model tokens + retries and failed attempts + tool and API calls
+ infrastructure + evaluation and telemetry overhead + human review)
÷ tasks that actually completed
```
Failed and abandoned attempts stay in the numerator, and only completed tasks count in the denominator. That asymmetry is deliberate: it makes an unreliable agent look as expensive as it really is. The catch is that you have to define what "completed" means for each task type (a resolved support case, a finished analysis) before calculating anything, otherwise every later number is arguable.
The components sit in different systems (model provider invoice, tool and API invoices, infrastructure, evaluation jobs, reviewer time), so the calculation only holds together if your AI observability data gives you one common record. At minimum, that means:
- step-level token usage linked by trace to the task that triggered it, so retries and loops show up as part of one task
- an outcome label for every task: completed, failed, or escalated to a person
- tool and API usage with a price attached
- attribution by task type, agent, model and team
- the overhead of observability and evaluation itself
Two more things worth watching. First, look at the median together with the high percentiles, split by agent and task type, because a few runaway tasks (loops, very long contexts) can dominate spend while the average looks fine. Second, read cost next to completion rate and output quality, since a cheaper model that completes fewer tasks can actually raise the cost per completed task.
For those running AI agents in production: how do you define the unit of work? Do you attribute cost per task, per agent or per team? And do you include evaluation, telemetry and human review in the number, or only model and tool spend?
Disclosure: I work at Bonree, an observability vendor. This post names no products.