Trimio Field Notes

AI Agent Economics Start With the Session, Not the Token

September 22, 20267 min readfinopsagentscost-attributionrouting

One user action can trigger several to dozens of model calls. Tools, retries, planning steps, memory retrieval, evaluator passes, and fallback routes all sit behind the button the user actually pressed.

Yet most AI cost reporting still stops at the token. That unit is useful for billing. It is not sufficient for operating an agentic product. Engineering leaders need to know what a workflow accomplished, which route it took, and whether the result justified the spend.

The correct accounting boundary is increasingly the agent session: a bounded unit of work with a beginning, an outcome, and an auditable cost trail.

1
User action
Can fan out into many model and tool calls.
3–4
Hidden cost layers
Retries, tools, memory, and fallback are easy to miss.
1
Useful operating unit
A session tied to outcome, quality, route, and spend.

Tokens are a meter, not a business outcome

The Pattern
Token spend answers “how much text moved?” It does not answer “what work was completed?” or “was the result worth the cost?”

Token counts are the natural first metric because providers expose them consistently. They are also dangerously easy to optimize in isolation. A shorter prompt can reduce input cost while increasing retries. A cached context can lower one line item while adding retrieval calls. A cheaper model can produce a result that requires more repair work.

For a simple completion, token economics may be close enough to task economics. For an agent, they diverge quickly. A coding task may include planning, repository search, tool execution, test failure, a repair loop, and a final review. Counting only the final model call hides the work that made the answer useful.

Where a session's cost actually goes
Primary generation
48%
Tool and retrieval calls
22%
Retries and repair
18%
Evaluation and fallback
12%
Illustrative accounting model, not a benchmark. The point is to measure every component instead of assuming the first line is the whole bill.

The session is the right boundary

Essential
A session connects the request, route, organization, model configuration, retries, tools, quality result, and final cost into one record a finance or engineering leader can inspect.

A useful session record does not need to be complicated. It needs to be complete enough to explain the economics:

This is not bureaucracy. It is the minimum needed to distinguish a cheap successful task from a cheap failed attempt, and a costly successful task from a costly loop that never completed.

Cost per completed task beats cost per request

Bottom Line
The metric that belongs in a planning meeting is cost per completed task: total session spend divided by verified successful outcomes, with failed and unresolved sessions visible beside it.

Suppose a workflow spends $0.20 per request and completes 80% of tasks. Its expected cost per completed task is $0.25 before accounting for human repair. A workflow that spends $0.28 per request but completes 98% of tasks costs about $0.29 per completed task. The second system is more expensive at the request level and cheaper at the business level.

That denominator changes routing decisions. The cheapest capable model is not always the lowest-cost path if it creates more retries or lower-quality outputs. Conversely, a more capable model may be wasteful on routine work. Routing should optimize for the least expensive configuration that clears the task's quality floor, not the lowest price in a rate table.

MeasureWhat it tells youWhat it misses
Cost per requestProvider and route efficiencyTask completion and repair work
Cost per tokenPricing and prompt behaviorOutcome quality and retries
Cost per completed taskEconomic efficiency of the workflowRequires a defined outcome contract

Routing needs evidence, not just a winner

Weak control

“Model A is cheaper.”

A static price comparison ignores task mix, configuration, cache state, retries, and whether the answer cleared the quality floor.

A rate card is not a decision record.
Strong control

“This configuration won this task.”

The route is backed by configuration-level evidence, provenance, observed quality, uncertainty, and realized session cost.

A decision record is reusable evidence.

That distinction matters when the system interpolates quality from neighboring configurations or has no exact measurement. An inferred score can be useful for routing. It should not be presented as if the exact configuration was benchmarked. The session record should preserve whether evidence was exact, interpolated, or unknown.

The same rule applies to live routing. If admission stops at the first winner, record that prefix honestly. Do not describe it as an exhaustive catalog census. Offline analysis can evaluate every candidate later; production accounting should reflect what was actually attempted.

What to instrument this week

Operator Checklist
Start with five fields: session ID, completed-task status, total spend, route/configuration provenance, and quality result. Add retries and tool calls next.
  1. Create a stable session ID at the workflow boundary and propagate it through every model and tool call.
  2. Aggregate spend across primary calls, retries, memory retrieval, evaluators, and fallback providers.
  3. Record outcome state as completed, failed, cancelled, or unknown. Do not collapse unknown into success.
  4. Attach route evidence including candidate checks, selected configuration, and exact versus interpolated quality data.
  5. Report by organization, application, session, commit, and subagent so finance and engineering can ask different questions of the same facts.

Do not begin with a dashboard redesign. Begin with a trustworthy event model. A plain export that reconciles to provider invoices is more valuable than a polished chart with an incomplete denominator.

The CFO question is changing

For Finance
The question is moving from “what did we spend on models?” to “what did we spend to complete this class of work, and did it meet the quality bar?”

That question is answerable only when attribution and evaluation are joined. Organization-level spend supports showback. Session-level spend explains behavior. Commit and subagent attribution explains which engineering workflows are driving growth. Quality and confidence explain whether the spend bought a useful result.

This is the economic layer AI-native companies are missing. Not another provider dashboard. A decision record that survives an invoice review, an incident, and a model change.

The bottom line

Tokens remain important. They are the raw material of the bill. But the operating unit for agentic AI is the session: a bounded piece of work with a route, a cost, an outcome, and evidence.

Once that record exists, routing can optimize for completed-task economics. Finance can forecast workflows instead of guessing from token growth. Engineering can see whether a new tool or model improved the system or merely added calls.

Trimio is building the evidence layer for accountable AI routing: configuration provenance, session attribution, quality evaluation, and cost in one decision surface. See how it works.

Trimio
Measure the work. Govern the cost.
trimio connects routing, quality, attribution, and spend so AI teams can operate on completed-task economics.