Table of Contents
For multi-tenant AI SaaS, accurate metering of usage drives revenue. The metering layer must be: accurate (no missing requests), idempotent (no double-counting), auditable (customer disputes), real-time (rate limit at the budget). Build correctly from day one.
Meter: tokens (input + output), requests (count), storage (vector store volume), fine-tune compute (GPU minutes). Collect at gateway from structured logs; aggregate to billing system (Stripe Metering, Orb, custom). Reconcile daily; expose usage to customer dashboards. Build idempotent collection; never double-count.
Billable units
- Input tokens: typically billed at lower rate
- Output tokens: typically billed at higher rate
- Requests: per-request fee for some product tiers
- Vector storage: GB-month of indexed data
- Fine-tune compute: GPU-minutes consumed
- Embedding requests: separate from LLM
- Hosted-API fallback: passed through at cost or marked up
Collection
- Source of truth: structured JSON logs at gateway (request_id + tenant_id + tokens + cost)
- Aggregation: ClickHouse / Postgres window functions for daily / monthly totals
- Reconciliation: daily job verifies all logged requests counted
- Customer dashboard: show real-time usage; help avoid surprise bills
- Audit trail: per-request log preserved for retention period
Billing
- Stripe Metering: standard metering primitive; integrates with subscription billing
- Orb / Lago: specialised metering platforms
- Custom: when complex pricing requires bespoke logic
- Pre-bill audit: monthly pre-bill review with sample of customers
- Customer-facing usage page: transparency builds trust
Verdict
For AI SaaS, accurate metering is revenue-critical. Build idempotent collection from day one; reconcile daily; expose usage to customers. Stripe Metering or Orb / Lago for standard cases; custom only when pricing model justifies it. Audit trail for customer disputes is mandatory.
Bottom line
Idempotent metering; daily reconciliation. See cost attribution.