At a glance
- Define the billable boundaries before the first invoice: cached input, retries, truncation, safety blocks, cutoffs.
- Reconcile by request ID on a sample, then extrapolate; never argue about the aggregate first.
- Put a dispute window and a log-export obligation in the contract.
- A provider that cannot return request-level evidence cannot win a reconciliation argument, and should not expect to.
Token reconciliation has a reputation for being adversarial. In practice most disagreements are definitional. The buyer counts tokens one way, the provider another, and neither number is wrong until the contract says which boundary applies. The dispute then lasts as long as it takes someone to find that sentence, which is often never, because the sentence was not written.
This piece describes a reconciliation process that works on an existing contract, and the clauses that stop the same argument from recurring.
Where meters disagree
Six boundaries account for most of the gap between an internal counter and a provider invoice.
- Cached input. Is a cache hit billed at full input rate, a discount, or not at all? Is the cache read counted in the token total?
- Retries. A regenerated answer consumes tokens twice. Whether both attempts are billable depends on who caused the retry.
- Truncation. Output cut by a max-token limit may be billed in full even though the user never saw it.
- Safety blocks. A blocked completion can consume prefill and some decode before stopping.
- Tool calls and structured output. JSON schema tokens, function definitions and re-prompts are easy to miss on the buyer side.
- Cutoff timezone. A usage window ending at midnight UTC is a different month than one ending at local midnight.
Each boundary is defensible. The problem is having two of them. For the underlying measurement questions, see Measuring Effective Tokens.
Reconcile requests, not totals
The fastest way to lose a reconciliation is to open with the aggregate. A difference of a few percent across millions of requests can be argued forever. A difference of a few percent traced to one rule can be settled in an afternoon.
- Pick a window. One day, or one stable traffic segment, with no deploy or prompt change inside it.
- Pull request IDs. Ask the provider for the request-level export for that window.
- Join on your side. Match request IDs to your own logs, including retries and cache hits.
- Classify the gap. Tag each unmatched token to one of the six boundaries above.
- Agree a rule. Apply the agreed rule to the full period and adjust the invoice once, prospectively if possible.
If the provider cannot supply request-level data, the reconciliation cannot proceed. That is itself a finding, and it belongs in the renewal conversation.
The contract language that prevents the next dispute
Three clauses do most of the work.
Defined billing events. A short table in the contract that states, for each event — input, cached input, output, retry, blocked output, truncation — whether it is billable and at what rate. This is not boilerplate. It is the document the reconciliation will cite.
Dispute window and evidence. A stated period, typically 30 to 60 days after invoice, in which the buyer can request request-level logs, and the provider must return them within a fixed number of business days.
Provider-caused retry credit. An error budget: retries above a threshold caused by provider failures are credited automatically, without the buyer having to prove each one.
What we watch
- Whether the contract defines “token” by reference to the tokenizer, or loosely.
- Whether cache discounts are per-request or only implied by a blended rate.
- Whether the provider publishes a service-level error budget that maps to retry credits.
- Whether invoice exports include request IDs at all.
A clean reconciliation is not a sign of a generous provider. It is a sign that both sides wrote down what they meant. The bill then becomes what it should have been from the start: evidence of work performed, in units both parties can check.
Questions buyers ask
Why does our internal token counter disagree with the provider's invoice?
Usually because the two sides count different boundaries. Providers may bill cached input differently, count retries, include truncation or exclude safety-blocked output. Start by comparing definitions, then compare a sample of request IDs.
What sample size is enough for a token audit?
A few hundred consecutive requests from a stable workload is usually enough to find systematic differences. The goal is not statistical proof of every token; it is to identify which rule produces the gap and apply it to the full period.
Should retries be billable?
Retries caused by provider-side failures should not be. Retries caused by the buyer's prompt or output handling are work the service performed. The contract should separate the two, with an error budget for the provider's share.