Introduction
Lago is an open-source billing API designed for usage-based pricing. It handles metering, subscription management, invoicing, and payment orchestration — replacing expensive SaaS billing platforms like Stripe Billing and Chargebee.
With 9.5K+ GitHub stars and AGPL-3.0 licensing, Lago provides the billing infrastructure for AI companies, API platforms, and consumption-based SaaS products.
Core Features
- Usage metering: Ingest events via API with count, sum, max, and other aggregation modes
- Flexible pricing: Per-unit, tiered, package, percentage, and usage-based pricing models
- Subscription management: Create plans with recurring fees, add-ons, and trial periods
- Real-time invoicing: Auto-generated invoices with PDF export and tax calculation
- Payment orchestration: Automated collection via Stripe, GoCardless, and Adyen
FAQ
Q: Is Lago suitable for AI/LLM billing? A: Yes. Lago is built for usage-based billing and can track tokens, API calls, compute time, or any custom metric.
Q: Can I self-host? A: Yes. Deploy with Docker Compose, including PostgreSQL, Redis, and the web dashboard.