Use case
How to reconcile AI spend against the provider invoice
Your ledger says one number. OpenAI's or Anthropic's invoice says another. Reconciliation is what explains the gap, not what hides it.
Not yet in production: reconciliation is gated behind a flag that is not enabled today. Designed behavior: it reconciles the ledger against the provider invoice for that period, recording any difference as a new ledger_adjustments row rather than editing the original calls.
How Spendline does this
The ledger prices each call at the time it happens, using the rate Spendline had on record for that model. A provider invoice can differ from that for reasons like a rate change mid-cycle, rounding across a billing period, or a credit applied after the fact. Reconciliation is designed as the step where those differences get identified and closed with an adjustment, rather than left as an unexplained gap between two numbers nobody trusts, so the ledger ends up matching the invoice with the discrepancy fully explained. That step, along with the rest of month close (validate, close, reopen), is gated behind a flag not yet enabled in production, so today this describes the design rather than something you can run. The ledger itself, including the property that nothing already written is ever mutated or deleted, is live regardless of whether reconciliation is turned on.
Why it matters
A ledger that never reconciles against the real invoice is just an estimate with extra steps. The value of reconciliation is specifically that discrepancies get explained and recorded, not smoothed over silently, which is also why adjustments are designed as new rows: the discrepancy and its resolution both stay in the record.
Frequently asked questions
Can I run reconciliation today?
Not yet. The reconciliation endpoint, along with the rest of month close (validating, closing, reopening a month), returns a 503 while it is disabled in production. The ledger keeps recording every call in the meantime; nothing about attribution or the append-only guarantee depends on this flag.
What if the provider invoice is simply wrong?
The design has the reconciliation step surface the discrepancy either way; resolving it with the provider is outside Spendline's scope. In the meantime, the ledger keeps an accurate record of what Spendline observed, which is the evidence needed to raise it with the provider.
Does reconciliation require the month to already be closed?
Yes, by design. Reconciliation is the final step of the month-close state machine (open, ready, closed, reconciled); it is meant to happen after close, against a period that is already immutable, which is what makes the resulting adjustment trustworthy.
See where this stands in your own setup
This page describes the mechanism. The 5 minute assessment scores your own attribution, enforcement, and reconciliation setup, so you know exactly which of these problems you actually have today.
Run the 5 minute assessment