Audit AI inference cost allocation integrity

Reconcile provider AI invoices bottom-up to workload and route usage, price terms, cached requests, retries, fixed charges and credits without combining currencies or silently allocating unexplained spend.

What it's for

Shows exactly where AI spend went—and whether invoice, gateway and chargeback numbers genuinely reconcile before leaders act on them.

What you give it

Inputs split into evidence read from your connected systems, calibration your team owns, and numerical controls that affect precision but never the result's meaning.

Field Type Role Required
billing_statements array of objects (14 fields) Evidence Yes
max_detail_rows integer ≥ 1, ≤ 500 Numerical control Optional
maximum_relative_reconciliation_error number ≥ 0, ≤ 1 Your calibration Optional
minimum_evidence_coverage number ≥ 0, ≤ 1 Your calibration Optional
pricing_terms array of objects (10 fields) Evidence Yes
workload_usage_cells array of objects (16 fields) Evidence Yes

Each workload_usage_cells record

Field Type Required
allocated_credit number (≥ 0) Yes
allocated_fixed_cost number (≥ 0) Yes
attempt_request_count integer (≥ 0) Yes
attributed_variable_cost number (≥ 0) Yes
billing_statement_id string (non-empty) Yes
cache_read_units number (≥ 0) Yes
cache_write_units number (≥ 0) Yes
evidence_verified boolean Yes
id string (non-empty) Yes
input_units number (≥ 0) Yes
logical_request_count integer (≥ 0) Yes
output_units number (≥ 0) Yes
response_cache_hit_count integer (≥ 0) Yes
retry_request_count integer (≥ 0) Yes
route_id string (non-empty) Yes
workload_class_id string (non-empty) Yes
Example input
{
  "billing_statements": [
    {
      "attempt_request_count": 90,
      "billing_period": 10,
      "cache_read_units": 0,
      "cache_write_units": 0,
      "credit": 1,
      "currency": "USD",
      "evidence_verified": true,
      "fixed_cost": 10,
      "id": "invoice-a",
      "input_units": 90000,
      "logical_request_count": 100,
      "output_units": 18000,
      "provider_id": "provider-a",
      "total_billed_cost": 10.152000000000001
    }
  ],
  "pricing_terms": [
    {
      "billing_statement_id": "invoice-a",
      "cache_read_cost_per_million_units": 0,
      "cache_write_cost_per_million_units": 0,
      "currency": "USD",
      "effective_before_usage": true,
      "evidence_verified": true,
      "id": "price-a",
      "input_cost_per_million_units": 2,
      "output_cost_per_million_units": 4,
      "request_cost": 0.01
    }
  ],
  "workload_usage_cells": [
    {
      "allocated_credit": 1,
      "allocated_fixed_cost": 10,
      "attempt_request_count": 90,
      "attributed_variable_cost": 1.1520000000000001,
      "billing_statement_id": "invoice-a",
      "cache_read_units": 0,
      "cache_write_units": 0,
      "evidence_verified": true,
      "id": "usage-a",

Truncated for display — the full payload is 54 lines.

What you get back

This is the actual output of running the example above — computed by the same function the platform calls, not an illustration.

Example output
{
  "assumptions": [
    "Provider price terms were effective before usage, use the invoice currency and cover the same tokenizer, request, cache, discount, credit, tax and billing perimeter as the statement.",
    "Every logical request, attempt, retry, token/cache unit, fixed-cost allocation and credit appears exactly once in a tenant-scoped workload-route cell; missing usage is retained as a reconciliation failure.",
    "Workload and route attribution is a governed cost allocation, not causal value or employee productivity. Currency totals remain separate unless an independently governed FX conversion is supplied elsewhere.",
    "Passing accounting integrity does not prove spend is efficient, authorize chargeback, procurement or deployment, or justify a decision about a provider, team or person."
  ],
  "billing_statement_diagnostics": [
    {
      "allocated_credit": 1,
      "allocated_fixed_cost": 10,
      "attributed_variable_cost": 1.152,
      "billed_cost": 10.152,
      "billing_period": 10,
      "billing_statement_id": "invoice-a",
      "calculated_variable_cost": 1.152,
      "currency": "USD",
      "failed_gates": [],
      "provider_id": "provider-a",
      "reconciled_cost": 10.152,
      "relative_invoice_error": 0,
      "supported": true,
      "usage_cell_count": 1
    }
  ],
  "configuration": {
    "currency_rule": "costs_are_reconciled_and_reported_per_currency_without_cross_currency_addition",
    "maximum_relative_reconciliation_error": 0.005,
    "minimum_evidence_coverage": 0.95,
    "retry_rule": "attempts_equal_uncached_logical_requests_plus_retries"
  },
  "currency_summaries": [
    {
      "billed_cost": 10.152,
      "currency": "USD",
      "reconciled_cost": 10.152,
      "unreconciled_absolute_cost": 0
    }
  ],
  "decision": "ai_inference_cost_allocation_integrity_supported",
  "failed_gates": [],
  "method": "bottom_up_ai_invoice_workload_route_cost_reconciliation_v1",
  "summary": {
    "billing_statement_count": 1,

Truncated for display — the full payload is 64 lines.

How it works

Statistical audit & measurement — Check whether a number is fit to decide on: coverage, timing, reconciliation, and the gaps a dashboard hides.

  1. 1 Join each tenant-scoped provider statement to the price term effective before usage and to unique workload-route cells for the same billing perimeter.
  2. 2 Recompute variable cost from token, cache and request units; independently reconcile logical requests, post-cache attempts, retries, fixed-cost allocation, credits and net billed cost.
  3. 3 Report failures per invoice and cost per workload within currency, abstaining whenever accounting or evidence coverage gates fail.

Before you trust it

Every tool in the catalog ships with the conditions under which its answer is meaningful — and the conditions under which it should abstain instead of guessing.

Assumptions & guardrails

  • Metric definitions, weights, aggregate grain, sampling, missingness, dependence, and comparison windows correspond to the management claim being audited.
  • Invoice, price and gateway usage clocks, tokenizer definitions, discounts, taxes, credits and tenant boundaries describe the same immutable billing perimeter.
  • Association, instability, or measurement quality is not a causal effect and must not be converted directly into an individual employment decision.
  • Reconciliation establishes accounting integrity, not efficiency, causal value, vendor quality or employee productivity.

Minimum evidence

  • billing_statements: required and organization-defined
  • pricing_terms: required and organization-defined
  • workload_usage_cells: required and organization-defined

How to validate it

Validate on future periods or held-out aggregate units, compare with a simple baseline, and require stability across plausible metric definitions and decision thresholds.

Calibrating it to your org

Same for everyone

The mathematical kernel, validation rules, method version, and JSON output semantics are organization-independent; no tenant-trained coefficients or company benchmark is embedded in the function.

Specific to you

  • one point-in-time invoice-price-usage projection that retains zero cells and recomputes variable cost before reconciling request nesting, units, fixed charges, credits and net invoice within currency
  • tenant and billing perimeter, provider invoice/version, tokenizer/unit semantics, discounts/taxes/credits, cache and retry definitions, workload/route attribution policy, currency, reconciliation tolerance and evidence coverage

Calibration workflow

  1. 1 Define the management decision, target outcome, aggregate unit, privacy boundary, cadence, and prediction/intervention horizon for this organization.
  2. 2 Build a tenant-scoped historical cohort using only information available before each prediction or decision; preserve zero periods, censoring, assignment probabilities, and unresolved outcomes when the method requires them.
  3. 3 Estimate statistical parameters on training history, but obtain costs, utilities, risk tolerance, practical-effect thresholds, capacity, and policy constraints from accountable decision owners.
  4. 4 Validate on later time windows or held-out aggregate units at the deployment grain, against a simple baseline and the function-specific validation strategy.
  5. 5 Deploy only if the returned decision clears evidence, overlap, calibration, robustness, and guardrail checks; warning, unsupported, schema-gap, and fallback decisions are abstentions.
  6. 6 Monitor realized outcomes, data drift, coverage, and decision regret; recalibrate at a governed cadence or after a detected regime/definition change, never merely because a stakeholder dislikes the result.

Call it from your AI

You don't wire up 388 tools in your MCP client. The GitRevio MCP server exposes 18 tools, three of which let an agent search the catalog, read a tool's schema, and run it — so the assistant finds this one on its own.

gitrevio_capabilities_search
  { "q": "reconcile provider ai invoices bottomup to" }
  → finds "audit_ai_inference_cost_allocation_integrity"

gitrevio_capability_describe
  { "capability_id": "audit_ai_inference_cost_allocation_integrity" }
  → returns the input schema and agent guidance shown on this page

gitrevio_capability_run
  { "capability_id": "audit_ai_inference_cost_allocation_integrity", "arguments": { ... } }
  → returns the result shown above

Works in Claude Desktop, Claude Code, Cursor, Cline, Continue.dev, Goose and Aider. See the MCP server.

Related tools

Forecast AI inference avoidable cost

Forecast AI inference spend and the safely avoidable portion from semantic response caching, retry prevention and batching using tenant-local empirical-Bayes rates, log-normal unit demand, shared scenarios, Shapley savings attribution and cost VaR/CVaR.

Forecasting & survival

Optimize AI inference efficiency portfolio

Choose one governed AI inference efficiency design per workload across semantic caching, retry prevention, batching and unit reduction, maximizing risk-adjusted economic value under quality, latency, scenario availability, shared capacity, dependency, budget and CVaR-regret constraints.

Constrained optimization

Audit AI capability fallback integrity

Prove that every aggregate capability required when AI is unavailable has a current approved runbook and a sufficiently large, timely, successful, independently observed exercise conducted with AI actually disabled.

Statistical audit & measurement

Audit AI code change evidence integrity

Prove that aggregate AI-assisted coding evidence comes from prospectively registered, nonoverlapping treatment/control studies with immutable assignment, configuration, trace and mature-outcome denominators before anyone estimates an effect.

Causal inference & experiment design

Audit AI knowledge grounding integrity

Audit the complete AI knowledge supply chain from immutable source versions through indexed chunks and effective access policy to retrieved evidence, claim-level citations and honestly mature grounding outcomes, without treating unresolved answers as failures.

Constrained optimization

Audit AI model routing evidence integrity

Audit every live AI-model route against current version-matched local evaluation, uncontaminated temporal holdout, pricing freshness, residency, retention, reliability and genuinely independent provider fallback evidence, counting each workload's value at risk once.

Forecasting & survival

See every tool in AI cost, routing & return →

Ready to See Your Engineering work clearly?

Request a free demo