AI agent glossary
Cost per task
The total spend, mainly model tokens plus tool and infrastructure costs, needed for an agent to complete one unit of useful work.
Price per token tells you little about what an agent actually costs, because one task can involve dozens of model calls, growing context, retries, and paid tool calls. Cost per task adds all of that up for one finished outcome: one resolved ticket, one research report, one merged pull request.
It is the number that matters for decisions. A more capable model with higher per-token prices can be cheaper per task if it finishes in fewer steps and fails less often. Compare cost per successful task, not just cost per attempt.
To measure it, log token usage for every call in a trace and roll it up per task. The common levers for reducing it are prompt caching, trimming tool outputs, routing simple steps to smaller models, capping steps, and batching work that is not urgent.
A team finds their research agent averages around 40 model calls per report. Trimming fetched pages to the relevant sections cuts input tokens enough to halve the cost of each report.
Learn more in the course
Related terms
Go from definitions to doing
Learn to use and build AI agents in 65 practical lessons.