← home
MONETIZATION · BILLING

LLM usage metering for customer billing.

Operations guide · July 1, 2026

By the LLM CFO team

Usage metering is how SaaS platforms that resell LLM functionality track consumption per customer and translate it into a charge. Unlike internal chargeback, metering is customer-facing and contractual;it defines who owes what, when, and for how much. Getting metering right means choosing the right measurement points, handling provider discounts, and reconciling against the actual provider invoice.

Where metering lives in your architecture

Every LLM API call flowing through your platform passes through multiple layers. You can capture metering at any of them:

The right approach uses all three: gateway for real-time rate limiting and customer visibility, SDKs for enriched tagging, and provider invoices for monthly reconciliation.

Billing units: tokens, requests, or outcomes

You must choose what unit you charge customers by:

Most platforms start with token-based (cost recovery is clear) and gradually move to outcome-based (better positioning).

The discount math: cache-read, batch, and reasoning tokens

Providers discount certain token types dramatically:

The key: if the provider gives you a discount, you must decide whether to keep it or pass it through. Do not leave this ambiguous;it will become a contract dispute.

Handling retries, tool calls, and fallback paths

One user action often triggers multiple LLM requests:

Every alternate path in your application is a metering edge case. Build a decision tree early.

Idempotency and deduplication

Your metering system must be idempotent: the same request replayed twice should not produce two charges. This is hard at scale:

Without idempotency, every network hiccup becomes revenue loss (double charges that customers contest) or hidden cost (charges you ignore to avoid disputes).

Monthly reconciliation and variance investigation

At month close, reconcile your metered usage against the provider invoice:

  1. Sum your metered usage. All events for the month, converted to cost using your pricing table.
  2. Compare to the provider invoice. The numbers rarely match exactly. Variance under 2% is acceptable; variance over 3% means something is wrong.
  3. Investigate the delta. Common causes: (a) missing metering events (retries, tool calls, fallback paths you forgot to tag), (b) timestamp misalignment (requests in one month, invoiced in the next), (c) wrong pricing (you used last month's rates but the provider updated them), (d) provider bugs or adjustments.
  4. Fix the root cause. Do not manually adjust. If you are consistently short, fix your metering. If you are consistently over, fix your pricing table.

Reconciliation is also your audit trail. If a customer disputes a charge, you rebuild the bill from metered events and compare to your cost.

What to meter: the minimal set

Do not meter everything. Focus on the contractual signal:

Everything else (feature, endpoint, user, duration) is operational telemetry, not metering.

Related

← Back to llmcfo.com

FAQ

What is LLM usage metering for customer billing?

Usage metering is the process of tracking and measuring LLM consumption per customer to bill them. For SaaS platforms that resell LLM functionality, metering captures every token, request, or outcome flowing through each customer's account and translates it into a charge on their invoice. Unlike internal chargeback, metering is customer-facing and contractual.

Where should I install metering: gateway, SDK, or provider invoice?

The best metering point depends on your architecture. API gateway metering captures all requests at the boundary (simplest, low latency impact). SDK/client-side metering is easier if you control the SDKs but harder to validate (customers can see code). Provider invoice metering is the reconciliation source of truth but arrives weeks late. Most platforms combine all three: gateway for real-time customer dashboards, SDK events for fine-grain tagging, and provider invoice for monthly reconciliation.

What is the difference between token-based and request-based billing?

Token-based billing charges by the token consumed (input, output, cache-read, reasoning). This matches how providers price and gives the highest precision for cost recovery. Request-based billing charges a flat fee per API call regardless of token count. Token-based is more complex to implement but fairer when request sizes vary; request-based is simpler but can incentivize longer prompts that inflate costs.

How do I handle cached and batch tokens in customer bills?

Cache-read tokens are discounted by the provider (OpenAI ~50% of input, Anthropic ~90%). If you charge customers the full input rate for cached tokens, you keep the margin. If you pass the discount through, customers get the benefit but your margin shrinks when cache hit rates grow. Batch API tokens are discounted ~50% by the provider; again, you must decide whether to pass the discount to customers or keep it. Document your policy explicitly in your pricing terms;margin math depends on it.

How do I reconcile metered usage against the provider invoice?

Every month, sum your metered usage events (tokens, requests, or outcomes by customer) and compare the total cost against the provider invoice. Variance over 2–3% usually signals missing events (retries, tool calls, fallback paths) or timestamp misalignment (requests logged in one month but invoiced in another). Document recurring deltas and fix the root cause;incomplete metering, clock drift, or provider bugs. Reconciliation builds customer trust and prevents margin leaks.

Why is metering different from observability or logging?

Observability logs every detail for debugging. Metering logs only the signal needed for billing: customer ID, token count, model, timestamp, cost. Metering must be idempotent (replayed events do not double-charge), exactly-once delivery is hard at scale, and the events themselves are the contractual record. If your observability system loses an event, that is a bug. If your metering system loses an event, that is lost revenue.