Most token tracking starts too late. The tools that teams reach for, provider usage dashboards and usage APIs, report tokens after the request has already been processed and billed. The OpenAI cookbook shows how to pull completions usage and costs from the Usage API, which is exactly the right instrument for reconciliation and exactly the wrong one for prevention, because the data only exists once the money is spent (the Usage API and Cost API guide).
The consequence is an asymmetry. A single call is cheap, but the cost of a call is not resolved until runtime: it depends on input tokens, output tokens, model tier, and whether reasoning tokens were consumed before the visible answer (the Worklytics guide). Four variables that resolve at runtime are four variables you can estimate in advance, with different error bands. Output length is the least certain, the model choice is usually fixed by routing, and input length is entirely under your control if you count it yourself.
There is also a governance argument. When spend is only visible as an aggregate number, teams have to reconstruct the request behavior behind an increase from logs and dashboards, and the three recurring failure modes are runaway agent loops, retry storms, and context bloat (Braintrust's cost tracking playbook). Every one of those failure modes is visible in an up-front estimate before the first call. None of them is obvious in an invoice line item.
So the decision rule is simple: if you cannot state an upper bound on the tokens a run will consume, you have not sized the run, and you should not admit it. The rest of this article is how to produce that bound with a spreadsheet-level of effort.



