Lago is a free, open source finance & accounting project written in Go and released under AGPL-3.0. It has 10,568 GitHub stars, 750 forks and 23 open issues, and was last pushed 10 hours ago. On this registry it ranks #4 of 34 tracked projects in Finance & Accounting, with 5 head-to-head comparisons available. It gained 33 stars over the last 6 tracked days.

What is Lago?

What it is

Lago is an open-source metering and usage-based billing API written in Go under AGPL-3.0. It lives in the Business Software and Finance & Accounting ecosystem and sits between product usage and revenue. It turns events such as AI tokens, compute, API calls, seats, and custom events into billable metrics, pricing, credits, entitlements, invoices, and payments.

The problem it solves is the gap between product telemetry and billing systems. Products need to meter complex usage in real time, apply changing prices, and collect payment without rebuilding billing logic for every model, plan, or customer contract. Lago provides a programmable path from usage events to metering, pricing, credits, entitlements, invoices, payments, and revenue analytics.

Key capabilities

  • It ingests usage events and creates billable metrics for AI tokens, compute, API calls, seats, and custom events.
  • It applies pricing, prepaid credits, automatic top-ups, subscriptions, allowances, minimum commitments, and overages.
  • It generates invoices and orchestrates payments through Stripe, Adyen, GoCardless, or another provider.
  • It exposes billing primitives through a REST API, SDKs, webhooks, and an MCP server.
  • It provides a Lago UI for product, finance, and operations teams.
  • It supports Lago Direct for monetizing a company's own product and Lago Embedded for letting customers monetize through a platform.
  • It keeps metering and pricing independent from payment processing, so a provider's catalog does not become the source of truth.

Who uses it and how

  • AI product teams meter token usage, price input and output events, and inspect charges in customer, subscription, and usage views.
  • Platform operators use Lago Embedded to expose billing capabilities inside their product through APIs and white-label interfaces.
  • Engineering teams integrate Lago by sending usage events through the REST API, SDKs, webhooks, or MCP server.
  • Finance and operations teams use the Lago UI to review customers, metrics, plans, subscriptions, events, and usage.

Getting started

The README shows a local demo started with ./examples/agentic-ai-demo/run.sh, which uses Docker Compose and requires Docker, curl, and jq. Lago Cloud is referenced as a hosted option.

When to use it — and when not to

Lago fits teams that need API-first metering, pricing, entitlements, invoices, and payments for complex usage data, especially AI workloads or platform monetization. It is less suitable when a team only wants a hosted billing UI without operating an integration layer, because the core model is headless and API-first. Self-hosters must run the Docker Compose-based service and manage the supporting stack implied by the Go, ClickHouse, events, and billing topics, while AGPL-3.0 may require legal review.

project readme (upstream, from github) — read inline

Lago

Agentic-first, open-source monetization infrastructure for AI products
Meter tokens, compute, API calls, or any product usage.
Turn usage into pricing, credits, entitlements, invoices, payments, and revenue.
Use Lago Direct for your own product, or Lago Embedded to power monetization for your customers.

Run the AI billing demo · Documentation · Talk to us about Lago Cloud

GitHub stars Latest release AGPLv3 license Lago Slack community

“Lago has been able to follow the pace of our releases and has allowed us to focus on what we do best.”
Timothée Lacroix, CTO at Mistral AI · Read the customer story


See Lago price an AI workload

Run the maintained demo from this repository:

./examples/agentic-ai-demo/run.sh

It starts the Lago version that matches this checkout, creates a disposable local organization, and prices three illustrative AI requests. Each request sends one input-token event and one output-token event:

3 AI requests
5,000 input tokens  x $0.000002 = $0.01
1,250 output tokens x $0.000008 = $0.01
Lago usage total                   = $0.02

Docker Compose starts an isolated Lago service, then a small script seeds and verifies the example through Lago's API. It retrieves current usage, independently reconciles the result, and retries one transaction to confirm that usage does not increase. Everything stays on your machine; the demo does not access Lago Cloud. The bundled credentials and API key are disposable and only intended for this local demo.

Log into http://localhost:8080 with [email protected] / agentic-ai-demo-local-password, then open Customers → Agentic AI Demo Customer → Agentic AI Demo subscription → Usage.

Requirements: Docker, curl, and jq. If ports 8080 or 3001 are occupied, set LAGO_DEMO_UI_PORT and LAGO_DEMO_API_PORT before running. The demo keeps Lago running so you can inspect the customer, metrics, plan, subscription, events, and usage in the UI. Remove its isolated Compose project and data volume when you are done:

./examples/agentic-ai-demo/run.sh --cleanup
Use Claude Code, Codex, or Cursor

Open this repository in your coding agent and paste:

Run Lago's maintained Agentic AI demo by following this README. Keep it local;
do not modify source files or unrelated Docker resources. When it passes, give
me the UI URL, token usage and charges, idempotency evidence, and cleanup
command. Then offer to connect this agent to Lago's local MCP server.

What is Lago?

Lago is the programmable system between product usage and revenue. Send events from your application, turn them into billable metrics, apply pricing and entitlements, then generate invoices and collect payments.

Usage events -> Metering -> Pricing and credits -> Entitlements -> Invoices -> Payments -> Revenue

Use Lago to launch and change pricing without rebuilding billing:

  • tokens by model, input, output, cache, reasoning, or tool call
  • GPU, CPU, storage, and other compute consumption
  • API calls, transactions, seats, active users, or custom events
  • prepaid credits with automatic top-ups
  • subscriptions with allowances, minimum commitments, and overages
  • self-serve plans and negotiated enterprise contracts in the same system

Lago is headless and API-first. Your application, internal tools, and agents use the same billing primitives through the REST API, SDKs, webhooks, and MCP server. Product, finance, and operations teams can use the Lago UI when a human interface is faster.

How Lago fits into your stack

Lago keeps metering and pricing independent from payment processing. Connect Stripe, Adyen, GoCardless, or another provider without making its product catalog your source of truth.

Lago Direct and Lago Embedded

The same Lago engine supports two operating models:

Lago Direct Lago Embedded
Who monetizes You monetize your own product Your customers monetize through your platform
Experience Your application and teams use Lago through APIs, agent interfaces, and Lago UI Your customers use billing capabilities inside your product through APIs and white-label interfaces
Brand Lago powers your billing stack Lago stays behind the scenes under your brand
Public example Mistral AI PayPal

Lago Direct is the standard way to use Lago: send your own product usage, model your pricing, and bill your customers. Lago Embedded uses the same primitives to let platforms, marketplaces, AI builders, fintech products, and developer tools offer metering and billing to their customers.

Both models start with Lago's open-source billing engine and can be paired with Premium deployment, customization, security, and support options. With Lago Embedded, you control the customer experience and which capabilities your users can access.

Agentic-first by design

Agentic-first means Lago's billing model is available as structured, inspectable interfaces instead of being trapped in a dashboard.

Interface What it enables Availability
REST API and OpenAPI Program every core billing workflow and generate typed clients or tools from the schema Open source
Lago MCP server Give an MCP-compatible agent tools to read and write invoices, usage, customers, payments, credit notes, coupons, and other Lago primitives Open source, MIT
Lago Agent SDK for Python Wrap supported LLM clients, normalize usage, and send token or model-cost events without blocking the LLM call Open source, MIT
Lago Agent SDK for JavaScript and TypeScript Instrument OpenAI, Anthropic, Mistral, Gemini, and AWS Bedrock clients with under 5 ms p99 wrapper overhead Open source, MIT
Finance Assistant Ask read-only questions about billing, usage, and revenue in plain language Beta, early access
Billing Assistant Query billing data and run operations in natural language, with confirmation for important or destructive actions Premium beta, available upon request

The MCP server exposes read and write tools and inherits the permissions of its Lago API key. Treat agent credentials as privileged, control who can access the agent, review tool calls, and keep human confirmation around sensitive billing changes.

Platform

Layer Capabilities
Meter usage Real-time event ingestion, filters, dimensions, custom aggregations, batch ingestion, and idempotency by transaction_id
Model pricing Usage-based, recurring, prepaid, percentage, graduated, package, volume, min

readme truncated — read the full docs on github

Frequently asked questions

Is Lago free to use?

Lago is open source under the AGPL-3.0 licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does Lago do?

Transform complex usage data into accurate, real-time billing

What is Lago written in?

Lago is primarily written in Go. Its source is publicly available at https://github.com/getlago/lago, and it has 10,568 GitHub stars.