The Two-Ledger Model: Transaction-Grain Cost Accounting for Multi-Agent AI Systems Across Clouds, Models, and Systems of Record
Organizations: Independent Researcher, Dallas, TX, USA
Abstract
Enterprises run business transactions through multi-agent AI systems spanning clouds, large language models (LLMs), orchestration harnesses, and systems of record. Finance receives AI cost only at settlement grain, aggregated by SKU and charge period. The business question (what did this order, claim, or case cost in AI?) cannot be answered from billing data, because providers never see enterprise transaction boundaries. The FinOps Open Cost and Usage Specification (FOCUS) gives billing data one schema across providers but remains settlement-grain even as it adds AI token and requester attribution. We formalize this grain mismatch, derive seven requirements, and propose the Two-Ledger Model: a settlement ledger of FOCUS-conformant billing data joined to an attribution ledger of invocation-grain usage records built on OpenTelemetry GenAI telemetry. A layered correlation spine (trace context, A2A/MCP metadata, business-key correlation, probabilistic matching) assigns each record to its business transaction with recorded method and confidence; a versioned rate card prices usage in near real time; period reconciliation ties both ledgers to the invoice, and the unexplained residual identifies shadow AI. Costs are reported per order, claim, or outcome with agentic cost metrics. A simulation with known ground truth shows the spine sustaining cost coverage above 99% as trace propagation falls to zero, the reconciliation residual recovering planted unmetered spend within 0.24 percentage points while flagging provider billing errors, and mid-flight gating cutting p99 transaction cost by up to 61% at a 2-4% false-pause rate. We propose the attribution ledger as an invocation-grain FOCUS profile for standardization.
Figures & tables
| Version | Ratified / target | Headline additions |
|---|---|---|
| 1.0 | Jun. 2024 | Core schema; four major clouds |
| 1.1 | Nov. 7, 2024 | Granular multi-cloud columns |
| 1.2 | May 29, 2025 | SaaS and PaaS billing support |
| 1.3 | Dec. 4, 2025 | Allocation columns; contract |
| commitments; data finality flags | ||
| 1.4 | Jun. 4, 2026 | Invoice reconciliation; commitment |
| ID | Requirement |
|---|---|
| R1 | Provider neutrality. One accounting model across clouds, model vendors, SaaS AI, and self-hosted inference. |
| R2 | Transaction grain. Every BT has a cost object; every attributable invocation maps to exactly one BT, across systems of record. |
| R3 | Business language. Costs roll up to the enterprise process taxonomy and to outcome units (per order, per claim, per case). |
| R4 | Agentic completeness. Fan-out, delegation (A2A), tool calls (MCP), retries, and failed attempts are all captured and classifiable. |
| R5 | Economic fidelity. Negotiated rates, commitment amortization (provisioned throughput), cache and batch tiers, per-call tool fees, and shared-infrastructure allocation are reflected. |
| R6 | Reconcilability. Attributed cost ties to invoices period by period; the variance is measured and decomposable. |
| Field | Runtime source (OTel GenAI / W3C) | Settlement analog (FOCUS) |
|---|---|---|
| trace_id , span | traceparent [ 12 ] | — (absent) |
| bt_id , bt type | propagated baggage / correlation spine (§ V ) | x_bt_id , x_bt_type |
| outcome id | business event | x_outcome_id |
| tenant, app, env | resource attributes | Tags |
| agent id, harness | gen_ai.* agent spans | 1.5 PrincipalId / RequesterDetails |
| credential | workload identity | 1.5 CredentialId |
| Component | Responsibility | Key interfaces | Typical realization |
|---|---|---|---|
| 1 LLM gateway | Meters every sanctioned model call; enforces workload authN, policy, and budget gates; stamps agent and credential identity; prices rows on write | In: model calls with trace context; out: attribution rows, gate verdicts; onward: provider endpoints | LLM-gateway–class proxy (Envoy-based or commercial) |
| 2 SDK/sidecar emitters & usage pollers | Cover paths no proxy sees (embedded copilots, provider-managed agents, batch); backfilled rows carry lower-confidence source markers | OpenTelemetry GenAI spans; provider usage APIs | OTel SDK and Collector; scheduled collectors |
| 3 Attribution ledger | Invocation-grain system of record for usage; FOCUS-shaped rows with x_ business keys | Append stream in; SQL out to engines and marts | Lakehouse table (Iceberg/Delta class) fed by a stream |
| 4 Settlement lake | All billing truth: FOCUS exports and vendor invoices, gated on data-finality flags | Provider FOCUS exports (1.2 SaaS path for model vendors); invoice feeds | FinOps platform store or a lakehouse zone |
| 5 Rate card service | Versioned price book: list and negotiated rates, commitment-amortization rules, cache/batch/context tiers, tool fees | Pricing API to the gateway; settled-rate restatement to reconciliation; FOCUS 1.5 price-sheet sync when ratified | Internal service over a config repository |
| 6 Taxonomy & identity registry | One schema for every join key: PCF process codes, the tag taxonomy, agent PrincipalId and credential registry | Configuration to gateway, engines, and tagging pipelines | Workload identity provider + metadata catalog |
| Lvl | Mechanism | Where it works / fails |
|---|---|---|
| L1 | W3C traceparent + baggage carrying bt_id [ 12 ] | In-process and service-to-service within instrumented estates; fails at opaque SaaS boundaries. |
| L2 | Protocol metadata: bt_id and trace context carried in A2A task metadata and MCP call context [ 7 , 5 ] | Across agent and tool seams between cooperating parties; fails when a peer strips metadata. |
| L3 | Business-key correlation sets (BPMN-style): order no., case no., invoice no. + system event time windows [ 17 ] | Across systems of record (SAP, Oracle Fusion, ServiceNow, CRM) that expose business keys but no trace context; deterministic when keys are unique. |
| L4 | Probabilistic matching: temporal proximity, agent identity, tenant, workload fingerprint; emits confidence | Last resort for legacy or black-box paths; rows below a confidence floor fall to a pooled cost object, never silently to a BT. |
| Step | System of record | Agent | Provider / model | In tok | Out tok | $/Mtok (in; out) | Status / corr. | Est. cost |
| 1 | CRM | intake-agent | Azure OpenAI / frontier | 6,200 | 1,100 | 2.00; 8.00 | ok / L1 | $0.0212 |
| 2 | SAP | pricing-agent | AWS Bedrock / frontier | 9,800 | 1,900 | 3.00; 15.00 | ok / L2 (A2A) | $0.0579 |
| 3a | Oracle Fusion | order-agent | Vertex AI / frontier | 7,500 | 1,400 | 1.25; 10.00 | failed / L3 (order no.) | $0.0234 |
| 3b | Oracle Fusion | order-agent (retry) | Vertex AI / frontier | 7,600 | 1,500 | 1.25; 10.00 | ok / L3 (order no.) | $0.0245 |
| 4 | ServiceNow | exception-agent | Azure OpenAI / frontier | 12,400 | 2,600 | 2.00; 8.00 | ok / L3 (case no.) | $0.0456 |
| 5 | (coordination) | supervisor | AWS Bedrock / mid-tier | 5,000 | 800 | 0.80; 3.20 | ok / L1 | $0.0066 |
| Tags on | FOCUS | Observ- | Gateway | Two- | |
| billing | 1.4+1.5 | ability only | only | Ledger | |
| R1 neutrality | ✓ | ✓ | |||
| R2 txn grain | ✓ | ||||
| R3 biz language | ✓ | ||||
| R4 agentic completeness | ✓ | ✓ | |||
| R5 economic fidelity | ✓ | ✓ |
| Floor | Trace-only cov. | Spine cost cov. | Cost acc. | Pooled | L4 share | Misattrib. | ||
|---|---|---|---|---|---|---|---|---|
| 1.0 | 0.85 | 0.80 | 100.0% | 100.0% | 100.0% | 0.0% | 0.0% | 0.00% |
| 0.8 | 0.85 | 0.80 | 80.1% | 100.0% | 99.1% | 0.0% | 2.6% | 0.89% |
| 0.6 | 0.85 | 0.80 | 60.2% | 99.9% | 98.2% | 0.1% | 5.2% | 1.76% |
| 0.4 | 0.85 | 0.80 | 39.8% | 99.9% | 97.4% | 0.1% | 7.8% | 2.62% |
| 0.2 | 0.85 | 0.80 | 20.2% | 99.8% | 96.4% | 0.2% | 10.6% | 3.59% |
| 0.0 | 0.85 | 0.80 | 0.0% | 99.8% | 95.6% | 0.2% | 13.1% | 4.44% |
| Planted unmetered | Recovered residual | Error (pp) | Rate drift | Timing | Overbilling flagged / planted | Under-billing residual / planted |
|---|---|---|---|---|---|---|
| 0.00% | -0.00% | 0.00 | -1.19% | 0.40% | 16.89 | -2.94 |
| 0.87% | 0.84% | 0.03 | +1.28% | 0.38% | 17.06 | -2.97 |
| 1.73% | 1.67% | 0.06 | +0.61% | 0.36% | 17.23 | -3.00 |
| 3.40% | 3.28% | 0.12 | -0.23% | 0.30% | 17.57 | -3.06 |
| 6.56% | 6.33% | 0.23 | +0.43% | 0.17% | 18.24 | -3.18 |
| Gate threshold | p95 cost | p99 cost | Mean cost | Spend saved | False-positive rate | Runaways caught |
|---|---|---|---|---|---|---|
| ungated | $0.243 | $0.701 | $0.1581 | 0.0% | 0.00% | 0.0% |
| 0.5 | $0.220 | $0.276 | $0.1435 | 9.3% | 4.12% | 74.4% |
| 0.7 | $0.224 | $0.307 | $0.1467 | 7.2% | 3.69% | 74.4% |
| 0.9 | $0.229 | $0.358 | $0.1484 | 6.2% | 1.97% | 72.0% |
| 0.95 | $0.229 | $0.358 | $0.1484 | 6.2% | 1.97% | 72.0% |
| Self-assembly | Delivered accelerator | Productized join layer | |
|---|---|---|---|
| Who builds components 5 and 7 | Enterprise platform team, on the existing lakehouse | Integrator, from a reference implementation; enterprise owns it after handover | Vendor product, deployed in the customer’s account and lakehouse |
| Time to first value | Quarters | About a quarter | Weeks: reconciliation and shadow-AI report from existing billing and gateway data, before any instrumentation |
| Cost shape | Internal engineering plus a permanent rate-card and engine maintenance burden | Project cost; maintenance transfers to the enterprise | Subscription, priced on attributed spend or metered transactions; vendor maintains the rate card |
| Lock-in surface | None, but schema-drift risk against evolving standards | Low; open formats throughout | Bounded by the contracts: FOCUS and OTel GenAI in, FOCUS-shaped rows and gate decisions out |
| Best fit | Large platform organizations with FinOps and data maturity | Enterprises wanting the architecture without a new vendor relationship | Multi-cloud, multi-gateway estates needing finance-grade tie-out and a maintained price book |
| Component | Exemplar realizations | What they cover | What remains outside |
|---|---|---|---|
| 1 LLM gateway | MuleSoft Omni Gateway; Kong AI Gateway; LiteLLM; Portkey; provider-native endpoints | Token capture and limits, guardrails, MCP/A2A policy, identity propagation, correlation identifiers | Prices, invoices, and anything that bypasses the proxy |
| 2 Backfill emitters & pollers | OpenTelemetry GenAI SDKs and Collector; provider usage and billing APIs | Paths no proxy sees (embedded copilots, provider-managed agents, batch) | Lower confidence than gateway metering, by construction |
| 3 Attribution ledger | Iceberg/Delta tables on Databricks, Snowflake, or BigQuery | Durable, queryable invocation-grain store | The FOCUS-shaped x_ profile is a schema discipline, not a product |
| 4 Settlement lake | Apptio, CloudZero, Vantage, Finout; Microsoft FinOps toolkit | FOCUS ingestion, invoices, reconciliation to cash | Runtime usage and the transaction boundary |
| 5 Rate card service | — (build; gateway price maps seed it) | — | Negotiated rates, commitment amortization, and tier logic have no standalone vendor; the FOCUS 1.5 price sheet will anchor, not replace, it |
| 6 Taxonomy & identity registry | Entra ID / Okta / SPIFFE; Purview / Collibra / DataHub; APQC PCF content [ 16 ] | Workload and agent identity, catalogs, process codes | One key schema across traces, tags, and gateway metadata is governance work, not a purchase |
Cost-Aware Inference
Cost-aware inference allocates models, computation, and serving resources to meet quality goals at lower latency, energy use, and monetary cost.
See all 308 papers