Tracking spend on a simple AI feature is straightforward: one request, one call, one cost. Agentic workflows break that model. A single task can trigger a dozen or more model calls, plus tool calls, retries, and self-checks, and standard call-level tracking loses the thread entirely. To track agent spend, you have to track the task, not the call.

Why call-level tracking fails for agents

An agent decides, call by call, whether to retry, invoke a tool, or branch into a different approach. Two runs of the same task can take completely different paths and cost very different amounts. Counting individual calls tells you how busy the agent was. It cannot tell you what a task cost or why one task cost far more than another, because the relationship between calls and the task they serve is never recorded.

Tag every call with a task and session

The foundation of agent spend tracking is correlation. Every model call and every tool call an agent makes should be tagged with a session ID and a workflow ID at the moment it is made. That tagging lets you group a scattered series of calls back into the single task they belong to, the way a distributed trace groups spans across services. Without it, an agent task is a dozen anonymous requests.

Track cost per completed task

Once calls are grouped by task, the metric that matters is cost per completed task, measured against an accepted outcome rather than against any single call. An agent that finishes a task in a handful of calls is doing better work than one that needs fifty for the same result. That comparison is invisible at the call level and obvious at the task level.

Watch retry amplification

Agents combine two behaviors that inflate cost: they retry failed steps, and they loop internally until a validation condition is met. Track observed calls per task against the baseline a task should take. A task that should run a dozen calls but runs ninety is amplifying, and that ratio, not the raw token count, points you at the problem.

Track tool calls, not just model calls

Agents spend on more than the model. Searches, database lookups, code execution, and other tool calls add to the real cost of a task and often do not register as model calls at all. Tracking agent spend means capturing the whole task, every model call and every tool call it triggered, so the task cost you see is the task cost you actually pay.

The unit that makes agents legible

Agent spend only becomes manageable at the task level. Cost per completed task, retry amplification against baseline, and full tool-inclusive capture are the three views that turn an opaque agent bill into something you can explain and optimize. The individual calls will always look cheap and chaotic. The task they add up to is where the cost actually lives.