Explainer · 6 min read
Billed vs estimated AI spend: why tokens miss the invoice
By AI Spendbook · Published · Updated
Short answer
Estimated AI spend multiplies token counts by list prices; billed spend is what the provider actually charged. They differ because of cache pricing, batch and priority tiers, contract discounts and credits, tool and storage charges, untracked traffic and billing delays. Use the bill as the total and estimates only to split it.
Key takeaways
- Billed spend is the provider's charge; estimated spend is tokens times a price list, with full customer and feature detail.
- Six usual causes of the gap: cache pricing, service tiers, contract rates and credits, non-token charges, untracked traffic and timing.
- Never add billed and estimated amounts for the same day.
- A card charge settles an invoice or tops up a balance; match it to invoices, not to daily usage.

Every team that logs token counts eventually tries the obvious check: multiply tokens by the price list and compare with the invoice. The numbers almost never match. That is expected, and knowing why tells you which number to use for what.
What is the difference between billed and estimated AI spend?
- [Billed spend](/glossary/billed-spend) is what the provider charged, from its cost reports or billing export. It is the financial truth but has little detail: provider, model, project, day.
- Estimated spend is computed from your request logs: tokens × published price. It has full detail (customer, feature, user) but rests on assumptions about which price applied.
Why don't token logs match the OpenAI or Anthropic invoice?
- [Prompt caching](/glossary/prompt-caching). Cached input tokens are billed at a fraction of the normal input price, and writing to the cache can cost more. An estimate that treats all input as uncached will be too high.
- Service tiers. Batch processing is billed at about half price on several providers, and priority or flex tiers have their own rates.
- Contract rates and credits. Committed-use discounts, startup credits and negotiated rates change the bill but not the token counts.
- Non-token charges. Web search, code execution, file storage, fine-tuning and image or audio generation are billed separately.
- Untracked traffic. A script, a test environment or a teammate's notebook uses the same account but never reaches your logs.
- Timing. Billing data lags by hours to a day, and the provider's day boundary (usually UTC) may not match your logs' time zone.
How do you reconcile usage logs with the AI invoice?

Treat billing as the total for each day and provider, and use request data only to explain it. Then report three amounts side by side:
| Amount | Meaning |
|---|---|
| Billed | What the provider charged for the day |
| Attributed | The billed amount split across customers and features in proportion to their estimated cost |
| Unattributed | Billed spend with no matching request data |
For days the provider hasn't billed yet, show the estimate and label it as an estimate. Never add billed and estimated amounts for the same day, or the total counts the same spend twice. At month end the billed total is then tied to the invoice itself, as described in how to close AI spend.
Worked example: splitting one day's bill by estimated cost
Illustrative numbers. A provider bills $500 for a day. Request logs for the same day, priced at list rates, show customer A at $300 and customer B at $150, an estimate of $450. Customer A's share is 300 / 450 = two thirds, so A is attributed $500 x 2/3 = $333.33 and B $500 x 1/3 = $166.67. The $50 gap between estimate and bill is not added anywhere: it is spread in proportion, and the two customers still add up to the $500 billed. If the provider had billed a day with no request logs at all, that day's $500 would be unattributed.
attributed (customer) = billed (day, provider) x customer estimated cost / total estimated cost
| Question | Use this number | Why |
|---|---|---|
| What goes in the books? | Billed, plus labelled estimates for unbilled days | It is what the provider charges |
| What did customer X cost? | Attributed (billed split by estimated share) | Adds up to the bill, keeps the detail |
| Which prompt or feature is expensive? | Estimated, per request | Only request data has that detail |
| Is instrumentation complete? | Unattributed share of billed | Spend no request explains |
When is a gap between billed and estimated spend a problem?
- Unattributed spend that grows week over week usually means a new service isn't instrumented.
- Estimates far above billing usually mean cache or batch pricing isn't being applied.
- Estimates far below billing usually mean non-token charges or untracked traffic.
What are common mistakes when reconciling billed and estimated AI spend?
- Adding the estimate to the bill for the same day. Each day and provider has one total: billed if the bill exists, otherwise the estimate.
- Tuning the price list until the estimate matches the invoice. The gap carries information about caching, tiers and untracked traffic; hiding it removes the signal.
- Reconciling monthly totals only. Compare by day and provider, so a missing day or a one-off charge shows up where it happened.
- Booking reseller spend under the upstream model maker. An OpenAI model bought through OpenRouter is OpenRouter spend.
How do you count prompt caching tokens for Claude and OpenAI cost?
Cache tokens are the most common reason an estimate runs high or low. Providers report them differently:
- Anthropic:
input_tokenscounts only the input after the last cache breakpoint. Cache writes (cache_creation_input_tokens) and cache reads (cache_read_input_tokens) are separate fields, so total input is the sum of all three. Anthropic prices 5-minute cache writes at 1.25 times the base input price, 1-hour writes at 2 times, and cache reads at 0.1 times, with some per-model exceptions. - OpenAI: the input token count includes cached tokens, which are reported as a subset (
cached_tokens). Subtract them before pricing the rest at the normal input rate. - OpenTelemetry GenAI spans: input is defined to include cache tokens, so subtract the cache counts once.
Price each kind of token at its own rate. Treating cache reads as normal input overstates cost, and adding Anthropic-style cache fields to an input count that already includes them counts them twice. See Anthropic's prompt caching docs and OpenAI's for the exact fields.
How do you avoid double counting OpenRouter, card payments and observability tools?
- OpenRouter and other resellers. A request to an OpenAI model through OpenRouter is billed by OpenRouter, not OpenAI. Record it as OpenRouter spend with the upstream model kept as a detail, and tag the matching requests with OpenRouter as the provider. Booking it as OpenAI spend counts it twice once the direct OpenAI bill is also connected.
- Card payments. A charge on a Ramp or Brex card is a payment: an invoice being settled or a prepaid balance topped up. Match card transactions to provider invoices or credit purchases, not to daily usage. The usage is the expense; the card charge settles it. AI Spendbook's Ramp and Brex connectors keep only the card rows from AI vendors, matched by merchant name, and show cash paid per vendor and month next to the billed total, side by side and never added together. Like every connector, they are built from the vendor's public API documentation and tested with recorded responses, not yet against a live account.
- Observability tools and your own logs. Datadog, Langfuse, Helicone or a log table compute cost from tokens and a price list. They miss what any estimate misses and see only the traffic that reaches them, so their totals will not match the invoice.
AI Spendbook keeps billed, provider-reported and estimated spend in separate ledgers and labels every figure with its basis. The reconciliation section of the docs shows how the three relate.
Frequently asked questions
How close should estimated AI spend be to the invoice?
There is no fixed standard. A steady gap usually means a pricing assumption such as cache or batch rates; a growing gap usually means untracked traffic or a new charge. Track the gap per provider each month and investigate when it moves.
Should finance report billed or estimated AI spend?
Report billed spend as the total wherever a bill exists, and label the estimate for days not billed yet. Estimates are for splitting the total by customer, feature or team, not for replacing it.
Why is the estimated cost in Langfuse or Datadog higher than the OpenAI bill?
Usually because cached input, batch discounts or contract rates are not applied in the tool's price list, so every token is priced at the full list rate. Check cache token fields first.