Open-source pricing and billing layer between Stripe and your app, for subscriptions, credits, usage-based and overage pricing.
getlago/lago
Open-source usage-based billing platform that meters events, applies pricing and credits, and generates invoices and payments.
Open-source alternative to:Chargebee
Zuora
Stripe Billing
- Stars
- 10,704
- Forks
- 772
- Open issues
- 33
- Last commit
- 21 hours ago
What is it?
Lago is an open-source billing engine for products that charge based on usage, such as AI token consumption, compute, or API calls. Applications send usage events to Lago, which turns them into billable metrics, applies pricing models such as graduated, volume, package, and prepaid charges, and then produces subscriptions, invoices, credit notes, and payment collection.
The platform is API-first and headless, with a REST API, SDKs for Node.js, Python, Ruby and Go, webhooks, and an MCP server for AI agents. It also includes a web UI for product and finance teams. Metering and pricing are kept separate from payment processing, so providers such as Stripe or Adyen can be connected without becoming the source of the product catalog.
Lago can be self-hosted with Docker Compose or deployed on Kubernetes with Helm charts, and it supports dedicated workers for scaling events, billing and webhooks. Ingestion is idempotent by transaction_id, so retried events are not billed twice.
Key features
- 01Ingests usage events and deduplicates them by transaction_id.
- 02Supports graduated, volume, package, prepaid, and minimum-commitment pricing.
- 03Manages prepaid credits, allowances, and usage alerts.
- 04Generates subscriptions, invoices, credit notes, and taxes across currencies.
- 05Connects to payment providers such as Stripe, Adyen, and GoCardless.
- 06Offers REST API, SDKs, webhooks, and an MCP server.
Use cases
- Billing AI API customers by token or model usage with prepaid credits.
- Charging for compute-intensive workloads such as CI minutes or GPU time.
- Adding usage-based or metered plans to a SaaS product without building billing from scratch.
- Self-hosting a billing system to keep customer and financial data on your own infrastructure.
Quick start
- 1
Run the maintained Agentic AI demo script from the repository (requires Docker, curl, and jq)
./examples/agentic-ai-demo/run.sh - 2
Log into the local UI at http://localhost:8080 with the demo credentials from the README
- 3
Remove the demo's isolated Compose project and data volume when finished
./examples/agentic-ai-demo/run.sh --cleanup
Things to know
- The quick start needs Docker, curl, and jq, and runs the full Lago stack locally.
- The Billing Assistant is a Premium feature available on request.
- The project is licensed under AGPL-3.0, a copyleft license with obligations for networked modifications.
Topics
FAQ
- What is lago?
- Open-source usage-based billing platform that meters events, applies pricing and credits, and generates invoices and payments. Lago is an open-source billing engine for products that charge based on usage, such as AI token consumption, compute, or API calls. Applications send usage events to Lago, which turns them into billable metrics, applies pricing models such as graduated, volume, package, and prepaid charges, and then produces subscriptions, invoices, credit notes, and payment collection.
- Is lago free to use? What license does it have?
- lago is open source under the AGPL-3.0 license. Check the license terms before using it in commercial products.
- Is lago still maintained?
- Actively maintained. The last commit to lago was on Oct 21, 2026.
- What can I use lago for?
- Billing AI API customers by token or model usage with prepaid credits. Charging for compute-intensive workloads such as CI minutes or GPU time. Adding usage-based or metered plans to a SaaS product without building billing from scratch. Self-hosting a billing system to keep customer and financial data on your own infrastructure.
- How do I install lago?
- Run the maintained Agentic AI demo script from the repository (requires Docker, curl, and jq): ./examples/agentic-ai-demo/run.sh Log into the local UI at http://localhost:8080 with the demo credentials from the README Remove the demo's isolated Compose project and data volume when finished: ./examples/agentic-ai-demo/run.sh --cleanup
- Where can I get lago?
- The source code and installation instructions are on GitHub: https://github.com/getlago/lago
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
Open-source usage-based, credit-based and hybrid billing infrastructure with real-time metering, cloud or self-hosted.
Self-hostable or hosted invoicing app that handles invoices, quotes, projects, tasks, expenses and time tracking, built on Laravel.
Stripe's open-source SDKs and agent tooling for adding billing and payments to LLM and AI agent products.
Open source, cookie-free web analytics tool positioned as a privacy-first alternative to Google Analytics, available as cloud or self-hosted.
Open-source link attribution platform for short links, conversion tracking, and affiliate programs, built with Next.js and TypeScript.