How to Reconcile LLM Costs by Customer

Track estimated inference spend per customer and explain differences from provider costs without hiding unattributed usage.

19 November editorial batch, prepared for publication on 20 November.

Track LLM cost per customer by assigning the authenticated customer to each provider attempt, then pricing reported usage for that attempt. Reconcile customer estimates against the provider’s cost report at the level both systems can represent. For a shared project, that level may be the project and billing day. The provider total alone cannot identify the customer that made a request.

Keep attribution and pricing separate

Capture an opaque organization ID from your server-side tenancy check. Record the feature, provider project, served model, request ID, attempt ID and billing timestamp. If a customer brings their own provider connection, retain whose account pays for it. Show those requests in customer usage and exclude them from totals for your own provider account.

Keep provider-reported usage alongside the computed estimate. For text requests, preserve input, cached input and output fields as the provider defines them. Store the price version and currency. A rate change can alter a cost estimate without changing any token count. Record missing usage explicitly. A client disconnect can leave you without a terminal usage event even when the provider did work. See the retry and billing guide for how to keep attempts distinct.

Reconcile where both sides have evidence

The OpenAI Costs API exposes time-bucketed monetary amounts and supports grouping by project ID and line item. Inspect the dimensions before choosing a join. Start at the provider account, billing window and currency, then compare per project or line item when the same scope exists on both sides. Retrieve every page and retain the report window with your result. OpenAI Costs API reference

Keep list-price estimates separate from billed and effective costs. The FinOps Open Cost and Usage Specification defines these as separate cost measures. In your own ledger, name the measure on every export so a discount or credit can explain a difference without changing the original request records. FOCUS specification

Work a shared-project example

Suppose your request records estimate $72 for Customer A and $48 for Customer B on one hypothetical billing day. Another $10 of requests has usage but lacks a customer ID. The provider reports $136 for that project and day.

Item Amount Accounting treatment
Attributed request estimates $120 Show $72 and $48 in customer reports
Unattributed request estimates $10 Hold in an unallocated category
Provider total $136 Keep as a separate source amount
Provider total minus all estimates $6 Investigate the reconciliation variance

If your application team finds a $6 provider charge for offline evaluation, assign it to the evaluation owner after checking the project and period. The reconciliation difference is then zero and the $10 attribution gap remains open. A single percentage multiplier would hide both facts and could inflate the next customer report.

Before you compare days, check whether the provider assigns calls by start time, completion time or billing ingestion. A request that crosses midnight can move cost across reporting windows. If daily differences reverse on the next day, reconcile both days together before you investigate a supposed change in customer traffic.

Set an owner for each failure

Assign missing customer tags to the owning feature team. Assign missing usage to the instrumentation owner. Assign account charges with no request counterpart to the billing owner. Recheck cutoff differences after the provider refreshes its report. If you use the figures to assess margins, show which rows are estimates and how much remains unallocated. Avoid rounding each request to cents before aggregation, especially for high-volume features with small per-request charges.

Alectura estimates spend from list prices and groups it by customer, feature, model, provider and provider region. Use the platform reference to test one request path. Compare its usage and cost fields with one complete provider day before relying on customer totals in a financial report.

Source documents (2)

Trace a request through Alectura.

Bring a sample prompt and a customer policy. See what reaches the model and which decisions appear in the request record.

Try the quickstart

Keep reading

How to Measure LLM Prompt Cache Savings ↗Set Up Customer-Owned LLM API Keys in AI SaaS ↗Which AI outputs need a label under EU AI Act Article 50? ↗