Lago
Open source billing infrastructure that meters usage events, applies pricing and credits, and issues invoices for AI and SaaS products.
Open Source Alternative to:

Lago is the programmable system between product usage and revenue. Events arrive from the application, become billable metrics, pass through pricing and entitlements, and come out as invoices, payments, and revenue, which means pricing can change without billing being rebuilt.
The engine is headless and API-first. Applications, internal tools, and agents reach the same primitives through the REST API, SDKs, webhooks, and an MCP server, while product and finance teams use the interface when a human view is faster. Metering stays independent of payment processing, so Stripe, Adyen, or GoCardless can be connected without a provider's catalog becoming the source of truth.
Pricing can be assembled from whatever usage a product actually generates.
- Token metering: charges by model and by input, output, cache, reasoning, or tool call.
- Compute usage: GPU, CPU, storage, and other consumption billed from events.
- Prepaid credits: balances with automatic top-ups.
- Subscriptions: allowances, minimum commitments, and overages on top of recurring plans.
- Two operating models: Lago Direct bills your own customers, while Lago Embedded gives platforms metering and billing to offer to theirs.
The repository ships a maintained demo that prices three AI requests locally using Docker, curl, and jq. It seeds a disposable organization, reconciles the usage total independently, and retries one transaction to prove that usage does not increase. Nothing leaves the machine, and a cleanup flag removes the isolated Compose project and its data volume afterward.
Stars
10,509Forks
741Last commit
7 days agoRepository age
5 yearsLicense
AGPL-3.0Version
1.52.1Repository
getlago/lago
Auto-fetched from GitHub .
Open source alternatives similar to Lago:
Stars
Forks
Last commit
Stars
Forks
Last commit
Stars
Forks
Last commit