Ask what an AI agent costs and you will usually get a per-token number. It is the easiest figure to find and rarely the one that decides whether the project pays for itself.

Here is the full shape of the bill.

Inference is the visible cost

Start with the arithmetic everyone does. An agent handling 2,000 tasks a day, each consuming roughly 8,000 input tokens and producing 800 output tokens, is moving about 16M input and 1.6M output tokens daily.

At that volume the model bill is real but predictable, and it is the line that falls fastest — model prices have dropped consistently, and prompt caching cuts repeated context to a fraction of its list cost.

The mistake is optimising here first. Teams spend a month shaving 15% off token spend while the retry loop below quietly doubles it.

Retries are the invisible cost

Every agent has a failure path, and failure paths cost money twice: once for the attempt that failed, and once for the attempt that replaces it.

  • A tool call that times out and retries three times costs four times the tokens of the call that succeeds
  • A malformed structured output that triggers a repair prompt costs roughly two and a half times a clean generation
  • An agent that loops before hitting a step cap can cost an order of magnitude more than its median task

Instrument cost per completed task, not cost per call. The gap between those two numbers is your reliability problem expressed in currency.

The costs that never appear on the model invoice

Line itemTypicallyNotes
EvaluationOngoingSomeone has to keep the test set honest
Human review queueHighest earlyFalls as confidence thresholds tighten
Data pipeline upkeepSteadySources change schema without warning
Incident responseSpikyConcentrated around model and prompt changes
Model migrationPer upgradeRe-validation, not just a version bump

The review queue is the one that surprises people. A launch-week agent running at 60% auto-approval needs a human on 800 items a day. The same agent at 92% needs one on 160. That difference dwarfs the token spend, and it is bought with evaluation work rather than with a cheaper model.

Model migration is a recurring expense

Models are replaced faster than the systems built on them. Every migration means re-running the evaluation set, re-tuning confidence thresholds, and re-checking the prompts that quietly depended on the old model's habits.

Budget for it on a schedule rather than treating each one as a surprise. The teams that suffer are the ones who pinned a model version, never built an evaluation harness, and discover both facts on the day of a deprecation notice.

The number that actually matters

Divide everything above — inference, retries, review, upkeep — by the number of tasks the agent completed correctly and without human intervention. That is your true unit cost, and it is the only figure comparable to the manual process you are replacing.

It is usually higher than the token estimate in month one and dramatically lower by month six, because almost every line on this list falls with the same investment: knowing, precisely and continuously, how often the thing is right.