AI usage billing spans ingestion, pricing, policy, and revenue systems. This blueprint walks through the exact order we follow with new UsageBox customers who want implementation certainty.
Architecture Sketch
Picture a layered diagram: models → Usage API collectors → UsageBox ingestion → catalog + pricing → ledger + analytics. Each arrow includes latency budgets so the entire loop stays < 2 minutes.
Step-by-Step Blueprint
- Instrument workload telemetry: Tag every model call with tenant, workspace, and cost hints (tokens, GPU time, context window).
- Normalize events: Map telemetry to UsageBox meters, ensuring idempotent keys plus retries.
- Model catalog + plans: Re-create current pricing in UsageBox, then break out AI accelerators as add-ons.
- Build pricing automation: Use plan templates + calculators so PMs can launch rate changes without code deploys.
- Expose transparency surfaces: Customer dashboards, CSV exports, and FinOps alerts all ride on the same UsageBox data.
- Close the revenue loop: Push invoices + revenue packs into your finance system of record.
Architecture Notes
We run ingestion on Cloud Run with global load balancing, persist events in UsageBox, and stream them to BigQuery within 60 seconds. Catalog and pricing live in UsageBox as code-defined resources, while policy enforcement hooks into Redis- and LaunchDarkly-based feature flags.
Key Deliverables
- Usage API spec: JSON schema with validation + retry guidance.
- Automation pack: Scripts for plan migration, calculator publish, and Slack alerts.
- FinOps toolkit: dbt models + dashboards showing run-rate, anomalies, and margin.
By treating the implementation like an engineering release, teams avoid the “billing spreadsheet” detour and ship reliable AI monetization in a month.