
Tool Lago
Lago
Open-source metering and usage-based billing engine that turns usage events into prices, credits, invoices and payments.
What it is
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.
What it's 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
How to use it
Before you start
- Docker (for self-hosting)
- A payment provider account such as Stripe, Adyen or GoCardless
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 -dCommands are copied from the official documentation. Check the docs for the latest version before running them.
Limitations to know
- 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
Alternatives
Usage-based billing platform that meters events, prices them with credits, seats or hybrid plans and issues invoices.
Usage-based billing platform, now part of Stripe, for metering, pricing and invoicing usage, commits and credits.
Billing and entitlements layer on top of Stripe that tracks usage, credits and feature access for AI and SaaS apps.
MCP servers for this
MCP reference server that gives an AI client controlled read/write access to chosen local directories.
AWS Labs' collection of open-source MCP servers for AWS docs, the AWS API, infrastructure as code, databases, costs and more.
Paddle's hosted MCP server that lets agents search and call the Paddle Billing API in sandbox or live accounts.
Related resources
Self-hostable platform of AI 'Experts' coordinated by an assistant called Otto, with a visual block-based workflow builder.
AWS's managed service for calling 100+ foundation models from Anthropic, OpenAI, Meta, Mistral, DeepSeek, Amazon and others in your AWS account.
Anthropic's family of proprietary large language models (Opus, Sonnet, Haiku tiers) for reasoning, coding and agents.
Reactive backend platform where queries, mutations and actions are TypeScript functions, with realtime sync, auth, files and vector search.