Modern usage-based and metered billing stack for API-first products
Metered billing infrastructure for API products: ingest usage events, aggregate meters, invoice with overages, and report MRR accurately.
The Stack
Lago
— Open-source metering and billing engineLago's event ingestion API accepts batched usage events with idempotency keys, aggregates them into billing periods using configurable charge models (sum, count, max, unique count), and generates invoices via Stripe or Paddle. Self-hosted is free; critical for avoiding vendor lock-in on billing logic.
Alternatives: metronome, orb, amberflo
Stripe
— Payment processing and invoice settlementStripe Billing's Meters API handles basic usage aggregation for simpler models, but pairs with Lago for complex graduated tiers. Stripe handles card charging, dunning, and retries — don't rebuild payment collection logic when $0.5% transaction fee is justified by the reliability.
Alternatives: paddle, chargebee
Tinybird
— Real-time usage analytics API for customer dashboards optionalTinybird ingests usage events at millions of rows/second and exposes low-latency REST endpoints. Your product dashboard can query 'total API calls this billing period' in under 50ms — preventing the dreaded 'why is my bill so high?' support ticket.
Alternatives: clickhouse, posthog
Metronome
— Enterprise UBB platform with commitment tracking optionalMetronome handles prepaid credit drawdown, contract amendments, and multi-currency invoicing — features Lago lacks. Worth the premium ($1,000+/mo) when you have enterprise customers with annual commit deals that include overage tiers and credit rollovers.
Svix
— Usage limit and billing alert webhooks optionalSvix delivers threshold alerts (e.g. '80% of monthly quota used') to customer endpoints with retries and signed payloads. Customers integrate this into their own alerting pipelines to auto-scale or request quota increases before hitting hard limits.
Alternatives: hookdeck, trigger-dev
ChartMogul
— MRR and churn analytics for UBB revenue optionalUBB makes MRR inherently variable; ChartMogul normalizes invoice data from Stripe into recognized ARR, expansion MRR, and contraction MRR. Its Stripe integration syncs nightly and handles partial-month prorations that would otherwise skew cohort analysis.
Alternatives: baremetrics, profitwell-paddle
Amberflo
— All-in-one metering, rating, and pricing analytics optionalAmberflo combines event ingestion, real-time meter display, and pricing experimentation in a hosted platform. Useful if you want to avoid operating Lago infrastructure; pricing is usage-based which aligns incentives with your own growth.
Orb
— SaaS billing platform for hybrid pricing models optionalOrb's pricing model editor supports per-seat + per-event hybrid billing and bulk tier customization per contract — common at $50k+ ACV where every enterprise deal has custom pricing. Its plan amendment workflow avoids manual Stripe invoice adjustments.
Gotchas
- ⚠️ Usage events must be idempotent — if your API retries an event submission without a stable idempotency key, Lago will double-count it and overcharge the customer. Assign event IDs at the source (e.g. request_id), not at the ingestion layer.
- ⚠️ Stripe Meters has a hard limit of 1,000 meter events per second per account; above that you'll need Lago's batched ingestion or face dropped events. Test your peak load against Stripe's rate limits before going to production.
- ⚠️ TinyBird Pipes are append-only; retroactive usage corrections (refunds, disputed charges) require a separate 'correction event' pattern rather than updating existing rows. Define your correction schema upfront or you'll rewrite the data pipeline mid-quarter.
Related Stacks
End-to-end B2B SaaS subscription billing, auth, and product stack
Complete stack for launching a B2B SaaS with seat-based subscriptions, SSO-ready auth, feature flags, and error monitoring.
Sales ops, data pipeline, and revenue intelligence stack for B2B SaaS
Sync product data to CRM, track PQLs, automate revenue reporting, and wire sales ops without a $50k/year Salesforce implementation.