New here? Start this series at Part 1: Logging the answer tells you almost nothing
- Part 1: Logging the answer tells you almost nothing
- Part 2: Your AI feature has unit economics whether you measured them or not
- Part 3: Real users ask questions your test set never imagined
- Part 4: You cannot roll back a prompt you never versioned
- Part 5: Nothing broke, and the system is still getting worse
Say a feature ships in March and everyone is pleased. In June, finance asks why the model line has grown many times over while revenue has not moved, and nobody in the room can say which product surface is responsible.
That conversation is avoidable, but only before launch.
Budget the workflow, not the call
Per-token pricing invites you to reason about one call, but users never experience one call. They experience a workflow that fans out into a retrieval query, three model calls, two tool round trips and a re-ask when validation fails.
So the unit is cost per successful task. The word successful matters, because a run that ends in a retry loop still burns tokens, and a metric that counts only completions will understate the real number. Latency works the same way, since the p95 on your model call is not the number the user feels. Every step in the workflow is another chance to land in some component's tail, so measure p95 end to end.
Context discipline is the biggest lever left in any prompt nobody has audited since launch. Prompts accumulate an example here, a policy paragraph there, and full conversation history because summarising was harder. Nobody deletes anything, because deletion might hurt quality and quality is hard to measure. Six months later, half the spend is re-sending context that changes no answers.
Set the target per workflow
Not every path deserves the same budget. Decide the tier explicitly and write it down:
| Workflow class | Latency target | Cost ceiling | Default approach |
|---|---|---|---|
| Inline assist | under 300 ms | fractions of a cent | small model, hard cache, no tools |
| Interactive answer | 2 to 5 s, streamed | cents | mid model, retrieval, capped tool loop |
| Deep task | seconds to minutes | tens of cents | strong model, show progress, checkpoint |
| Batch or offline | hours | lowest per unit | batch API, off-peak, retry cheaply |
The numbers are yours to set, but choose them before shipping, so a regression becomes a visible breach rather than a drift nobody owns.
The levers, in the order I reach for them
Route first. Wherever low-risk requests make up the bulk of traffic, they do not need your best model. Classify the request, send easy ones down the cheap path, reserve the expensive path for what earns it. The router adds a hop of latency and fails quietly, sending hard requests down the cheap path, so evaluate it on the hard cases.
Cache second. Exact-match caching costs almost nothing and pays off wherever requests repeat, provided the key includes the tenant and the caller's permissions; without them it will serve one user's answer to another. Semantic caching helps too, but it has a real failure mode in which a near-miss returns a confidently wrong neighbour. Give it its own eval.
Batch third, wherever latency allows. Then degrade deliberately. Under load, a shorter answer from a smaller model beats a queue timeout, and you should decide which surfaces may degrade before you are inside the incident. Capacity planning is the unglamorous work of checking provider rate limits, queue depth and behaviour at three times normal load. Test the queue and its retries before your users do. Without backoff, jitter and a cap, a provider slowdown becomes a retry storm.
Attribution, or that June meeting
Tag every call with feature, tenant, model and outcome. Report spend along those dimensions weekly, to the team that can actually change it. Cost regressions should reach the same people quality regressions do.
Split last month's model invoice by feature and tenant using only the tags you have today. Whatever lands in "unattributed" is the spend nobody in that June meeting could explain.
Terms in this piece
About this explainer
- Format
- Explainer
- Level
- Practitioner
- Read
- 2 min read
- Published
- Sep 15, 2026
- Disciplines
Short mental models: one idea, why it matters, what to do about it.
More on these topics
Article · · 3 min read
The first AI skill is knowing when to leave the model out
Many model calls in production could be a simple rule. How to tell when a problem needs a model and when it does not.
Article · · 1 min read
What an AI gateway actually costs to run
The operational bill for one gateway in front of a dozen tool servers, including the costs nobody budgets for.
Explainer · · 2 min read
Every autonomous run needs a budget for cost, time, actions and risk
Limits on cost, time, actions, retries and risk are what make autonomy safe to switch on.
Discussion