# Lago

CreateWithAI Hub page: https://createwithaihub.com/finance/lago
Latest version of this file: https://createwithaihub.com/finance/lago.md

- Type: Tool · Category: Finance
- Publisher: Lago
- Pricing: Free plan plus paid plans · License: AGPL-3.0
- Runs on: Web, Linux, API (cloud), Docker / self-hosted

Open-source metering and usage-based billing engine that turns usage events into prices, credits, invoices and payments.

Lago ingests usage events from your app (tokens, API calls, compute, seats), aggregates them into billable metrics and applies pricing plans, prepaid credits and entitlements to produce invoices. It is headless and API-first, and collects payments through providers such as Stripe, Adyen or GoCardless rather than tying billing to one processor. You can self-host the AGPLv3 platform with Docker or use Lago Cloud. It is for product and engineering teams pricing AI or infrastructure products by usage.

Useful for: Billing an AI API by input and output tokens per model, with prepaid credits that top up automatically.

## Key features

- Real-time event ingestion with idempotency by transaction_id and atomic batches
- Usage, graduated, package, volume, percentage, minimum-commitment and hybrid pricing
- Wallets, credit grants, top-ups, entitlements and usage alerts
- Invoices, credit notes, taxes and dunning; payments via Stripe, Adyen, GoCardless and others
- Official MCP server (getlago/lago-agent-toolkit, MIT, Docker image) plus Lago CLI and Agent SDKs for Python and JavaScript
- Lago Cloud in US or EU: Launch plan with first $100,000 billed free (one-time), then 0.7% of billings

## Connection

- Billing model: Subscriptions, Usage-based / credits
- Who sells: Your own payment account
- Built for: Web apps & SaaS, APIs & MCP servers
- Hosting: Cloud, Self-hostable

## Before you start

- Docker (for self-hosting)
- A payment provider account such as Stripe, Adyen or GoCardless

## Install steps from the official documentation

Self-host (source):

```
git clone --depth 1 https://github.com/getlago/lago.git && cd lago && echo "LAGO_RSA_PRIVATE_KEY=\"$(openssl genrsa 2048 | openssl base64 -A)\"" >> .env && docker compose up -d
```

## Limitations

- Self-hosting means running and upgrading the platform (Postgres, Redis, workers) yourself
- Some features are premium only: custom roles, Okta SSO and audit logs (Scale, from $12,000/year), custom workflows, Billing Assistant and Lago Embedded (Enterprise)
- Core platform is AGPLv3, which carries network-use source obligations if you modify it
- Payment collection still requires a payment provider account

## Official links

- Website: https://www.getlago.com
- Source repository: https://github.com/getlago/lago
- Documentation: https://getlago.com/docs/welcome
- Source: https://github.com/getlago/lago (README: metering, pricing, credits, invoicing, payment providers, agent interfaces (MCP server, CLI, Agent SDKs, MIT), Docker deploy command; AGPL-3.0 license; active)
- Source: https://www.getlago.com/pricing (Self-hosted AGPLv3 free; Launch: first $100,000 billings free one-time then 0.7%, first 5M events free then $20 per million; Scale from $12,000/year and from 0.6%; Enterprise custom)
- Source: https://github.com/getlago/lago-agent-toolkit (Official Rust MCP server distributed as Docker image getlago/lago-mcp-server, 40 tools, LAGO_API_KEY and LAGO_API_URL env vars; MIT)
