Open Source Metering and Usage Based Billing API ⭐️ Consumption tracking, Subscription management, Pricing iterations, Payment orchestration & Revenue analytics

RAW Doc

Docker & Self-Hosted Deployment Verified OCI

Deploy lago on any server, homelab, or cloud container platform.

Repository: getlago/lago


Stars: 9540

README.md

<!-- PROJECT LOGO -->
<p align="center">
<a href="https://github.com/getlago/lago">
<img src="https://uploads-ssl.webflow.com/635119506e36baf5c267fecd/635b6df0ee8effaa54c1fa42_banner-open-graph.jpg" alt="Lago">
</a>

<h1 align="center">Lago</h1>

<p align="center">
The AI-native billing platform
<br />
Open-source metering, billing & revenue infrastructure for product-led companies.
<br />
<br />
<a href="https://doc.getlago.com">Docs</a>
·
<a href="https://getlago.com">Website</a>
·
<a href="https://www.getlago.com/slack">Slack</a>
·
<a href="https://github.com/getlago/lago/issues">Issues</a>
·
<a href="https://getlago.canny.io/">Roadmap</a>
</p>
</p>

<p align="center">
<a href="https://github.com/getlago/lago/stargazers"><img src="https://img.shields.io/github/stars/getlago/lago" alt="Github Stars"></a>
<a href="https://github.com/getlago/lago/releases"><img src="https://img.shields.io/github/v/release/getlago/lago" alt="Release"></a>
<a href="https://github.com/getlago/lago/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-AGPLv3-purple" alt="License"></a>
<a href="https://www.getlago.com/slack"><img src="https://img.shields.io/badge/Slack-community-%234A154B" alt="Slack"></a>
<a href="https://www.ycombinator.com"><img src="https://img.shields.io/badge/Backed%20by-Y%20Combinator-%23f26625" alt="YC"></a>
</p>

---

Trusted by

<p align="center">
<a href="https://www.getlago.com"><img src="https://getlago.com/customers/paypal.svg" height="30" alt="PayPal" hspace="12"></a>
<a href="https://www.getlago.com"><img src="https://getlago.com/customers/mistral-ai.svg" height="30" alt="Mistral AI" hspace="12"></a>
<a href="https://www.getlago.com"><img src="https://getlago.com/customers/groq.svg" height="30" alt="Groq" hspace="12"></a>
<a href="https://www.getlago.com"><img src="https://getlago.com/customers/synthesia.svg" height="30" alt="Synthesia" hspace="12"></a>
<a href="https://www.getlago.com"><img src="https://getlago.com/customers/laravel.svg" height="30" alt="Laravel" hspace="12"></a>
</p>

---

What is Lago?

Lago is the open-source billing platform for usage-based, subscription-based, and hybrid pricing models. If you can track it, you can bill for it.

- Open-source — self-host for full control over your data, or use Lago Cloud to get started faster. Either way, the code is transparent
- Payment-agnostic — works with Stripe, Adyen, GoCardless, or any payment gateway
- API-first — every feature available via REST API
- SOC 2 Type II certified

Features

| Feature | Description |
|---------|-------------|
| Usage Metering | Real-time event ingestion and aggregation for any pricing dimension |
| Billing & Invoicing | Automated invoice generation for subscriptions, usage, and hybrid plans |
| Entitlements | Feature access management tied directly to your billing plans |
| Cash Collection | Payment orchestration with dunning, retries, and multi-gateway support |
| Revenue Analytics | Cross-stream visibility into MRR, usage trends, and revenue drivers |
| Lago Embedded | White-label billing for platforms and marketplaces |
| Lago AI | AI-powered billing intelligence and MCP server for AI agents |
| Integrations | NetSuite, Xero, Salesforce, HubSpot, Avalara, AWS/Azure/GCP Marketplace, and more |

Get Started

Cloud (fastest)

Start billing in minutes — no infrastructure to manage.

Sign up for Lago Cloud or email [email protected]

Self-hosted

#### Requirements
- Docker & Docker Compose
- Git

#### Quick start

bash

Clone the repo


git clone --depth 1 https://github.com/getlago/lago.git
cd lago

Generate RSA key


echo "LAGO_RSA_PRIVATE_KEY=\"$(openssl genrsa 2048 | openssl base64 -A)\"" >> .env
source .env

Start Lago


docker compose up

Open http://localhost for the UI. The API is at http://localhost:3000.

#### After an update

bash
docker compose up

#### Configuration

If your server is not at localhost, set these in your .env:

text
LAGO_API_URL="http://your-server:3000"
LAGO_FRONT_URL="http://your-server"

For the full list of environment variables and advanced configuration (S3/GCS storage, SMTP, SSL, dedicated workers for high-volume), see the self-hosted docs.

#### Find your API key

1. Open the Developer section in the sidebar
2. Go to the API keys tab
3. Click Copy

Documentation

- Getting Started — Full documentation
- API Reference — REST API docs
- Billing Templates — Reproduce pricing models from Algolia, Segment, Mistral, OpenAI, and more
- Development Environment — Set up Lago locally for development
- Architecture — Technical architecture and flows
- Monitoring — Prometheus metrics and alerting

SDKs & Client Libraries

| Language | Package |
|----------|---------|
| Node.js | lago-javascript-client |
| Python | lago-python-client |
| Ruby | lago-ruby-client |
| Go | lago-go-client |

Full OpenAPI spec: lago-openapi

Stay up to date

- Public Roadmap
- Changelog
- Slack Community

Contributing

We welcome contributions! See our contributing guide and the development environment setup.

Look for issues labeled beginner or help-wanted to get started.

License

Distributed under the AGPLv3 License. Why we chose AGPLv3.

Analytics & Tracking

Lago tracks basic actions on self-hosted instances by default. No customer PII or financial data is collected. Learn more or opt out.