---
title: Why does AI spend in the gateway not match the provider invoice?
url: https://opencontroller.lyzr.com/blog/reconcile-ai-gateway-spend-with-provider-invoices
published: 2026-11-14
updated: 2026-11-14
author: Lyzr
---

# Why does AI spend in the gateway not match the provider invoice?

**Gateway spend is an estimate built from token counts and a price table. The invoice is what the provider actually charged, after discounts, credits, commitments, taxes and charges that never passed through the gateway. A gap of a few percent is normal; reconcile monthly, explain each cause, and investigate only when the gap exceeds a tolerance you agree with finance in advance.**

This question comes up in almost every rollout of an LLM gateway. Finance looks at the provider bill, the platform team looks at the gateway dashboard, and the numbers disagree. That does not mean either system is wrong. They measure different things. This guide sits under our [comparison of LLM gateways, agent gateways and control planes](/blog/llm-gateway-vs-agent-gateway-vs-control-plane).

## What does each number actually measure?

The gateway sees every request routed through it. It records input tokens, output tokens and, where the provider reports them, cached tokens. It then multiplies those counts by a price table someone configured. So gateway spend is a calculated figure.

The provider invoice starts from the provider's own metering. It then applies the commercial terms on your account: committed-spend discounts, promotional credits, batch pricing, regional uplifts and tax. It also includes usage that never touched your gateway.

## What are the most common causes of a mismatch?

| Cause | Which side is higher | How to confirm |
|---|---|---|
| Traffic that bypasses the gateway (direct SDK calls, console use, other teams) | Invoice | Compare provider usage by API key or project against gateway keys |
| Cached-token discounts not modelled in the price table | Gateway | Check whether cache reads are priced at the discounted rate |
| Batch API usage billed at a discount | Gateway, if priced at standard rates | Separate batch jobs in the gateway price table |
| Credits, commitments or negotiated discounts | Gateway | Ask finance for the effective rate per model |
| Retries and failed requests | Either | Check whether the gateway counts errored calls the provider did not bill, or the reverse |
| Billing period cut-off (UTC vs local time) | Either, at month boundaries | Re-run the gateway report in UTC |
| Stale price table after a price change or new model | Either | Diff the gateway price table against the provider's current price page |
| Seat licences, fine-tuning, storage and hosted tool fees | Invoice | These are line items with no tokens attached |
| Tax and currency conversion | Invoice | Compare pre-tax amounts in the billing currency |

Two of these deserve a closer look because they are large. OpenAI and Anthropic both price their batch APIs at 50% of standard rates, so a gateway that prices batch jobs at the standard rate will overstate that spend by half. With Anthropic prompt caching, cache reads are billed at 10% of the base input price and five-minute cache writes at 125%. A price table that ignores both can be off in either direction, depending on how much traffic hits the cache.

## How do you reconcile them each month?

Use the same process every month so the gap becomes predictable.

1. **Fix the window.** Pull both figures for the same calendar month in UTC, before tax, in the billing currency.
2. **Split the invoice by line type.** Separate token usage from seats, storage, fine-tuning and other fees. Only token usage should be compared with the gateway.
3. **Split by key or project.** Match provider usage by API key, project or workspace to the gateway's upstream credentials. Anything left over is bypass traffic.
4. **Apply effective rates.** Replace list prices in the gateway calculation with the effective rate per model after discounts and credits.
5. **Separate batch and cached tokens.** Price them at their own rates.
6. **Check request status.** Agree with the provider's documentation on which failed requests are billed, and make the gateway count the same way.
7. **Compute the residual.** Express the remaining gap as a percentage of token spend.
8. **Compare with tolerance.** If the residual is inside the threshold, record it and close. If not, open an investigation.
9. **Update the price table.** Fix any model, price or discount you found to be wrong, so next month starts closer.

## What tolerance should you set?

There is no standard number. Agree one with finance before the first close and write it down. Many teams start with a band of a few percent of token spend and tighten it as bypass traffic shrinks. The tolerance matters less than the rule: any gap outside it gets an owner and an explanation.

Track the residual over time. A steady small gap is a modelling issue. A sudden jump usually means new traffic is bypassing the gateway, which is a governance problem, not an accounting one. Our guide to [detecting unapproved LLM API traffic](/blog/detect-unapproved-llm-api-traffic) covers how to find it.

## Which numbers should you report to whom?

Report the invoice to finance. It is the legal record of what was paid. Use gateway figures for allocation: cost per agent, per team, per version, per task. The gateway is the only place that knows which agent made which call. The reconciliation tells you how far to trust that allocation.

A practical approach is to scale gateway allocations to the invoice total each month. If the gateway attributes 40% of token spend to one business unit, that unit carries 40% of the reconciled invoice amount, not 40% of the gateway estimate. Our guide to [attributing LLM costs to AI agents](/blog/how-to-attribute-llm-costs-to-ai-agents) explains the attribution side.

## How Opencontroller does this

Opencontroller's LLM Gateway (Lyzr Gateway) records cost attribution per agent and per version for traffic routed through it, with routing, fallback, retry and caching. Opencontroller also auto-discovers models and API keys across AWS, Azure and Google Cloud, which helps find the keys whose usage appears on the invoice but not in the gateway. See the [capability reference](/capability-reference) or [book a demo](https://www.lyzr.ai/book-demo/).

## Frequently asked questions

**Is the gateway or the invoice the source of truth for AI spend?**
The invoice is the source of truth for what was paid. The gateway is the source of truth for who spent it. Use both, and scale allocations to the invoice.

**Why is the gateway figure higher than the invoice?**
Usually because discounts are not modelled: batch pricing, cached-token rates, credits or committed-spend discounts. Apply effective rates per model and the gap should shrink.

**Why is the invoice higher than the gateway figure?**
Usually because some traffic bypasses the gateway, or because the invoice includes seats, storage, fine-tuning or other fees with no tokens attached.

## Key facts

- Gateway spend is calculated from token counts and a configured price table; the provider invoice reflects metering plus discounts, credits, commitments, other fees and tax.
- OpenAI and Anthropic price their batch APIs at 50% of standard rates.
- Anthropic prompt caching bills cache reads at 10% of base input price and five-minute cache writes at 125%.
- Reconcile monthly in UTC, pre-tax, comparing token usage only, split by API key or project.
- Scale gateway allocations per agent or team to the reconciled invoice total.
- Opencontroller's LLM Gateway attributes cost per agent and per version and auto-discovers API keys across AWS, Azure and Google Cloud.
- Opencontroller starts from $250K per deployment per year (annual licence per deployment, not per seat or usage).

## Related

- [How do you attribute LLM costs to individual AI agents?](https://opencontroller.lyzr.com/blog/how-to-attribute-llm-costs-to-ai-agents.md)
- [What AI spend reports does a CFO actually need?](https://opencontroller.lyzr.com/blog/ai-spend-reporting-for-finance-leaders.md)
- [How much can LLM caching save, and when is it unsafe?](https://opencontroller.lyzr.com/blog/llm-caching-savings-and-risks.md)
- [More on Gateways and cost](https://opencontroller.lyzr.com/blog/cluster/gateways-and-cost)
