lago
Open Source Metering and Usage Based Billing API ⭐️ Consumption tracking, Subscription management, Pricing iterations, Payment orchestration & Revenue analytics
⭐ 9,617 stars on GitHub · 🍴 597 forks · 📜 License: agpl-3.0 · 💻 Language: Go
What is lago?
Usage-based billing is hard to build well: you need reliable event ingestion, flexible pricing logic, invoicing, payments, and revenue reporting without turning your product team into a billing platform team. Lago stands out by giving you that stack as self-hostable, API-first infrastructure rather than locking metering and revenue data inside a commercial billing vendor.
Main components
- Usage metering for real-time event ingestion, aggregation, and billing dimensions.
- Subscription, usage-based, and hybrid billing with automated invoice generation.
- Pricing model management for iterating on plans, fees, credits, and consumption rules.
- Entitlements that connect feature access directly to billing plans.
- Payment orchestration across gateways like Stripe, Adyen, GoCardless, or custom providers.
- Revenue analytics for MRR, usage trends, cash collection, and revenue drivers.
- REST API, SDKs, and OpenAPI spec for integrating billing directly into your product backend.
Clear use cases
- Add usage-based billing to a SaaS product charging by API calls, seats, messages, storage, or compute.
- Replace a rigid commercial billing tool when your pricing model has outgrown simple subscriptions.
- Build hybrid pricing with base plans plus metered overages, credits, minimum commits, or tiered usage.
- Keep billing, customer, and revenue data under your own operational control for compliance or data residency.
- Run billing for an AI, infrastructure, fintech, or developer-tool product where consumption changes quickly.
- Embed white-label billing into a platform or marketplace that needs customer-facing invoices and plan management.
The biggest strength is pricing flexibility without giving up infrastructure control — Lago is designed for companies that expect pricing to change often and need billing logic exposed through APIs. Compared with commercial billing suites, the value is not just lower vendor lock-in; it is the ability to own the metering pipeline, connect it to your product events, and still get serious billing features like invoicing, entitlements, payment retries, and revenue analytics.
You should still treat it as core financial infrastructure, not a weekend sidecar. Self-hosting Lago means you are responsible for uptime, backups, worker scaling, email delivery, payment gateway setup, observability, and upgrade discipline. For a small app with simple monthly subscriptions, Stripe Billing or a lighter hosted tool may be faster. But if your business model depends on consumption, custom pricing, or complex enterprise billing, Lago is one of the strongest open-source options available.
Best for SaaS, AI, infrastructure, API, and platform teams that need flexible usage-based billing and want to self-host the system of record for metering and revenue workflows.
Topics: the project is tagged with popular topics:
- 🏷️
analytics - 🏷️
billing - 🏷️
clickhouse - 🏷️
events - 🏷️
fintech - 🏷️
go - 🏷️
ingestion - 🏷️
invoices - 🏷️
metering - 🏷️
open-source
Quick install
The project supports Docker Compose:
git clone https://github.com/getlago/lago.git
cd lago
docker compose up -d
Check the README in the repo for required env variables.
Minimum system requirements
| Component | Recommended |
|---|---|
| RAM | 4096 MB |
| CPU | 2 vCPU |
| Disk | 50 GB SSD |
| OS | Ubuntu 22.04 LTS / Debian 12 |
| Docker | 24.0+ |
⚡ Deploy fast on VSIS
Use the VSIS VPS Standard 4GB RAM / 2 vCPU / 50GB SSD (~150k/tháng) plan from VSIS.NET — high-speed VN-based VPS, 24/7 support, ideal for running lago smoothly.
🎯 Benefits:
- One-command
docker compose up -ddeploy in 2 minutes - Dedicated IPv4, root access, unmetered domestic bandwidth
- Daily snapshot backup
- Free install assistance from the VSIS team
👉 See matching VPS plans at vsis.net
Resources
- 🔗 GitHub: getlago/lago
- 🌐 Homepage: https://www.getlago.com
- 📚 Official docs: see README in the repo
- 💬 Community: GitHub Issues + Discussions
Article compiled from GitHub data on 05/05/2026. Star/fork counts may have changed — see live numbers via the GitHub link.
