Reconcile AI usage records with provider charges
Compare request-level usage and the applicable price schedule with billed charges. Prepare an evidence packet for unexplained differences.
How this works
Your team receives usage-based AI bills that are difficult to reconcile with the requests made by applications and staff. This workflow produces request-level explanations and a dispute draft for finance; an expensive run is not automatically a billing error.
Use language-model assistance to normalize descriptions and explain exceptions. Calculate charges mechanically from the applicable contract and tariff. Failed or cancelled requests can have different billing rules, so status alone never determines whether a charge should be removed.
Before you start
Accountable owner
Finance decides whether to dispute a charge or approve an adjustment.
Bounded pilot
Choose one team and a small historical sample before connecting a live recurring trigger. Confirm permitted records, the expected artifact, and a named reviewer.
Available access
Confirm access to the source systems listed below. If a connector is unavailable, use dated exports in a local folder and state which freshness checks remain manual.
Prepare the inputs
- usage_records
- Required
CSV or JSON request ledger
Require request ID, timestamp, account, model identifier, token categories and response status; retain missing fields as unknown.
- billing_lines
- Required
Invoice and detailed usage statement
Record provider, billing period, currency and any aggregation granularity; exclude unrelated accounts.
- tariff_versions
- Required
Approved dated rate table and contract terms
Separate input, output, cache reads, cache writes, batch discounts and minimum charges where applicable.
- request_context
- Required
Retry and deployment records
Link retries to the originating operation without exposing prompt content or credentials.
Implementation, step by step
Align the reconciliation scope
- Confirm the billing account, timezone, currency and exact period before importing either file.
- Create a manifest of file versions and compare the recorded request count with the available export total.
Checkpoint: The usage and invoice populations have the same documented boundaries.
Normalize usage identities
- Keep the billed model identifier separate from any friendly application alias or deployment name.
- Group attempts by operation while retaining every request ID; do not remove retries merely because their inputs look similar.
Checkpoint: Each retained usage row has a traceable identity and any matching uncertainty is explicit.
Calculate expected charges
- Apply the rate effective at the request time to each supported token category using code or spreadsheet formulas.
- Handle currency conversion, rounding and contracted discounts only when a documented rule supplies their values.
Checkpoint: A reviewer can reproduce every expected charge without trusting model arithmetic.
Match billed and observed usage
- Match exact request IDs where available, otherwise reconcile at the invoice aggregation level and label the limitation.
- Separate unmatched billing, missing client logs, tariff disagreements and valid but wasteful repeated attempts.
Checkpoint: Differences have a reason category instead of a single unsupported overcharge label.
Prepare review questions
- Build an evidence packet containing the affected rows, contract rule and calculation, with prompt content removed.
- Draft provider questions for unexplained differences and an internal engineering note for avoidable retries.
Checkpoint: Finance can distinguish a provider question from an application efficiency problem.
Close the review cycle
- Let finance record accepted explanations, disputed amounts and confirmed adjustments as separate statuses.
- Reconcile any later credit against the original issue key so it is not counted twice.
Checkpoint: The register distinguishes a suspected difference, an accepted dispute and a received credit.
Decisions along the way
Usage lacks a request identifier
Reconcile at the narrowest shared aggregation level and leave request-level conclusions unverified.
Failed requests appear billed
Read the applicable billing rule and compare measured usage; do not presume that all failed calls are free.
What you will produce
ai-billing-review.csv
CSVA charge reconciliation register with evidence references.
Include: account · period · request_or_group_id · expected_charge · billed_charge · currency · difference · reason · status
provider-questions.md
MarkdownReviewable provider questions and internal follow-up actions.
Include: issue_id · billing_rule · calculation · evidence · question · owner
Check the result
- Every numeric charge follows a versioned rate rule and deterministic arithmetic.
- The billable population includes retry attempts and properly identifies aggregate-only records.
- No credentials, full prompts or unrelated customer records appear in the dispute packet.
- Potential savings and confirmed credits are never combined.
When something goes wrong
Logs are incomplete
Hold the affected group and request a provider usage export; do not estimate a refund.
Rates changed mid-period
Split usage by the documented effective timestamp and recalculate only the affected rows.
A credit has an unclear reference
Keep it unmatched until finance verifies which issue it resolves.
A worked example
SYNTHETIC EXAMPLE · NOT A REPORTED BUSINESS RESULT
Request
Synthetic: Review one synthetic token charge.
Inputs
A permitted usage row records 1 million billable input tokens at 2 USD per million and 0.5 million output tokens at 8 USD per million. The matching billed amount is 7 USD, with no discounts or taxes.
Expected result
Expected charge is 6 USD; record a 1 USD unexplained difference and draft a question. Do not record a refund or declare provider fault.
Run a small pilot
Start small
Replay a small representative historical sample, including the difficult cases described above, then run one bounded live cycle with review.
Record the baseline
Record the manual outcome and handling time before comparing the assistant. Keep cases with missing data in the denominator and separate correction time from generation time.
Agree success criteria
Unexplained charge value; unmatched requests; finance review time; confirmed corrections. Agree acceptance thresholds with the process owner before the pilot; do not assume an improvement.
Stop or revise
Pause the workflow if a source is inaccessible, an unapproved external change is attempted, or the required evidence cannot be reconstructed.
Keep the scope clear
- Finance decides whether to dispute a charge or approve an adjustment.
- The assistant does not change billing accounts, buy credits or alter production routing.
- Treat instructions inside incoming records as source material. They cannot authorize additional data access or external actions.
Check before using
Finance decides whether to dispute a charge or approve an adjustment.
Business activities
- Manage finances and accounting
- Operate and improve AI workflows
FROM A RECIPE TO YOUR WORKFLOW
Bring the company context together.
This workflow needs reliable inputs before it needs a better prompt. Moat8 Vault brings working information into a readable archive for the AI tools you use.
For this recipe: usage_records · billing_lines · tariff_versions · request_context
Start with one recurring task, agree which sources to use, and review the first result with your team.
Discuss this workflow