Treat reconciliation as an audit-integrity problem
Reconciliation produces defensible evidence only when every outbound model call can be traced from the internal gateway record to the provider usage record. That traceability starts at the gateway, where each call receives a unique internal correlation ID and each attempt is recorded separately.
The sections below cover the fields to capture, the matching logic, the discrepancy categories to define up front, and how results are retained as audit evidence.
Reconciliation flow
The process moves through five stages, from capture at the gateway to retention of the results.
| Stage | Description |
|---|---|
| 1. Capture | Gateway writes one record per attempt with a correlation ID. |
| 2. Ingest | Provider usage and billing records are loaded on a schedule. |
| 3. Match | Identifier match first, then tolerance-based fallback. |
| 4. Classify | Each discrepancy receives a defined category and owner. |
| 5. Retain | Results are stored as evidence with a defined retention period. |
Minimum fields for every internal record
Each internal record should carry enough information to support both identifier-based matching and the tolerance-based fallback.
- A unique internal correlation ID, assigned at the gateway to every outbound model call.
- A separate record for each attempt, rather than one record per logical request.
- Any provider request identifier returned for the attempt.
- The time of the call, to support time-window matching.
- The model and the credential used.
- Token counts, for comparison within defined tolerances.
Matching logic and tolerance thresholds
Matching runs in two passes, in a fixed order.
- Identifier match. Match internal records to provider usage records by the provider request identifier first.
- Tolerance-based fallback. For records without an identifier match, compare time window, model, credential, and token counts within defined tolerances.
Define the tolerances before the first run so that results are consistent and can be defended later.
Discrepancy categories to define up front
Every unmatched or divergent record is classified into a fixed discrepancy category, and each discrepancy receives a defined category and owner. Agreeing on the category list before reconciliation begins keeps classification consistent from one run to the next.
Investigation, evidence, and retention
Provider usage and billing records are loaded on a schedule, matched, and classified, and each discrepancy is routed to its owner for investigation. The results are retained as audit evidence and stored with a defined retention period.
Where a runtime governance layer fits
Reconciliation depends on the quality of the internal record. A runtime governance layer helps generate consistent, auditable records for LLM calls and tool use, so that the gateway side of the comparison is complete before provider records are matched against it.