# Lago

> Open-source, API-first billing platform for usage-based, subscription, prepaid, and hybrid pricing, with metering, invoicing, and revenue analytics.

Lago is a billing platform from Lago, built around metering product usage and turning it into pricing, credits, entitlements, invoices, and payments. It is available as hosted Lago Cloud or as a self-hosted, AGPLv3-licensed open-source edition. The latest GitHub release listed is v1.57.0.

## What It Is

Lago sits between product usage and revenue. Applications send usage events, which become billable metrics. Pricing and entitlements are applied to them, and Lago then generates invoices and coordinates payment collection. Usage can include tokens by model, GPU or compute consumption, API calls, seats, or custom events.

Lago does not replace a payment processor. It calculates charges, generates invoices, and applies tax, while a connected provider handles payment.

## Billing and Pricing Workflow

The documented platform covers real-time event ingestion with idempotency by transaction ID, and batch ingestion. Pricing models include usage-based, recurring, prepaid, percentage, graduated, package, volume, minimum-commitment, and hybrid charges. Prepaid credits support wallets and top-ups, and usage alerts are also described. Invoices, credit notes, taxes, multiple currencies, and customer-specific overrides are supported. Revenue analytics, revenue recognition, dunning, and quotes and order forms are part of the platform.

## Developer and Agent Interfaces

Lago is headless and API-first. It offers a REST API with an OpenAPI 3.1 specification, signed webhooks, and SDKs for languages including JavaScript, Python, Ruby, and Go. A Lago CLI lets users run billing commands from the terminal. An MCP server gives MCP-compatible assistants tools for billing data and operations, and it inherits the permissions of its API key. Agent SDKs for Python and JavaScript wrap supported LLM clients to send token usage events. Lago also describes Finance and Billing assistants and a Dunning Agent.

## Deployment Model

Lago Cloud is run by Lago. Teams can instead self-host with Docker Compose or Helm charts, on-premise or in their own cloud. The README includes a local demo that prices illustrative AI requests with Docker, curl, and jq. Lago states it is SOC 2 Type II certified. Lago Embedded offers white-label billing for platforms.

## Features
- Real-time usage metering with idempotent event ingestion
- Usage-based, subscription, prepaid, and hybrid pricing models
- Prepaid credits, wallets, top-ups, and usage alerts
- Invoicing, credit notes, taxes, and multi-currency support
- Entitlements and quotas
- Quotes and order forms
- Cash collection with dunning and payment retries
- Revenue analytics and revenue recognition
- REST API, OpenAPI spec, webhooks, and SDKs
- Lago CLI
- MCP server for AI assistants
- Agent SDKs for LLM usage metering
- Finance and Billing AI assistants
- Lago Embedded white-label billing
- Self-hosting and Lago Cloud deployment
- Role-based access control

## Integrations
Stripe, Adyen, GoCardless, Salesforce, HubSpot, NetSuite, Xero, Avalara, OpenAI, Anthropic, AWS Bedrock, Google Gemini, Mistral, Cloudflare AI Gateway, Databricks AI Gateway, Snowflake Cortex, Ramp Router

## Platforms
LINUX, WEB, API, DEVELOPER_SDK, CLI

## Pricing
Open Source, Free tier available

## Version
v1.57.0

## Links
- Website: https://getlago.com
- Documentation: https://getlago.com/docs/welcome
- Repository: https://github.com/getlago/lago
- EveryDev.ai: https://www.everydev.ai/tools/lago
