lago
Open Source Metering and Usage Based Billing API ⭐️ Consumption tracking, Subscription management, Pricing iterations, Payment orchestration & Revenue analytic
What is lago?
Open Source Metering and Usage Based Billing API ⭐️ Consumption tracking, Subscription management, Pricing iterations, Payment orchestration & Revenue analytics
Overview of lago
What it is
Lago is an open-source metering and usage-based billing API. It acts as the programmable system between product usage and revenue, handling consumption tracking, subscription management, pricing iterations, payment orchestration, and revenue analytics. The project is licensed under AGPL-3.0 and is categorized under Analytics and Ecommerce. It is designed to be headless and API-first, allowing applications, internal tools, and agents to use the same billing primitives through REST API, SDKs, webhooks, and an MCP server. Lago supports two operating models: Lago Direct for monetizing your own product, and Lago Embedded for platforms to offer billing capabilities to their customers.
Key features
- Real-time event ingestion with filters, dimensions, custom aggregations, batch ingestion, and idempotency by
transaction_id - Usage-based, recurring, prepaid, percentage, graduated, package, volume, minimum-commitment, and hybrid charges - Integration with Stripe, Adyen, GoCardless, or other payment providers - REST API and OpenAPI schema for programming core billing workflows - Lago CLI (MIT license) for terminal billing commands - Lago MCP server (MIT license) for MCP-compatible agent tools - Lago Agent SDKs for Python and JavaScript/TypeScript (MIT licensed) to instrument LLM clients
Use cases
- Metering tokens by model, input, output, cache, reasoning, or tool call - Tracking GPU, CPU, storage, and other compute consumption - Billing for API calls, transactions, seats, active users, or custom events - Managing prepaid credits with automatic top-ups - Subscriptions with allowances, minimum commitments, and overages - Supporting both self-serve plans and negotiated enterprise contracts in the same system
Getting started
See the repository README for full instructions.
License and pricing
The project is open source under the AGPL-3.0 license. Pricing is not stated in the metadata or README.
Based on the project's public README and repository metadata.