Articles
Article I: Immutable Metering

Article I: Immutable Metering

The Law of Observability

You cannot govern what you do not ledger. Cost visibility after the fact is forensic accounting, not governance. Production AI systems must treat every inference as a financial transaction recorded before the response is served.

Section 1: The Micro-Ledger

Every single token generation must map to a discrete, itemized cost calculation before the response is served to the user.

This means:

  • Pre-response accounting — cost is computed at request time, not batched into nightly ETL jobs
  • Per-call granularity — no aggregating "AI spend" into a single monthly line item
  • Immutable records — ledger entries are append-only; corrections create offsetting entries, never silent edits
  • Provider-agnostic schema — input tokens, output tokens, cached tokens, reasoning tokens, and tool-call overhead each get distinct line items

A system that cannot answer "what did this exact user action cost, in USD, at the moment it completed?" has not implemented metering. It has implemented hope.

Section 2: Cost Normalization

The system must natively translate volatile API schema pricing across different providers into a single, immutable USD equivalent.

Providers change prices without warning. Models rename. Cache discounts appear mid-quarter. Your ledger cannot depend on human spreadsheet updates.

Requirements:

  • Pinned rate tables — pricing snapshots versioned in source control, refreshed on a defined cadence
  • USD as the canonical unit — all cross-provider comparisons happen in normalized dollars, not raw token counts
  • Historical fidelity — recalculating past costs uses the rates that were active at transaction time, not today's rates
  • Multi-provider equivalence — a 4,000-token call to GPT-4o and a 4,000-token call to Claude must be comparable in the same dashboard without manual conversion

Token counts lie. Dollars tell the truth.

Section 3: Feature-Level Attribution

Tokens must be tagged not just by model, but by the specific feature, user, and session triggering them.

Model-level attribution answers "which API is expensive?" Feature-level attribution answers "which product decision is expensive?" Only the second question changes behavior.

Mandatory tags on every ledger entry:

DimensionPurpose
featureThe product surface (e.g., summarize-document, agent-research)
user_idThe customer or internal actor
session_idThe discrete workflow or conversation
modelProvider and model identifier
environmentproduction, staging, or development

Without feature tags, FinOps becomes a blame game between engineering and finance. With them, it becomes a product optimization loop.


Next: Article II: The Routing Mandate


Tokenminning · Built by Narev