Billing with Lago
What Lago is for in a Brume instance, who it is aimed at, and how to leave it off — billing is an Enterprise option, never a requirement.
In brief
Lago is the billing engine Brume uses to resell consumption to third parties: plans, subscriptions, invoices. It exists only in Enterprise, it is off by default, and an instance running on its own keys (BYOK) has no use for it. To install it, see Enterprise with Docker Compose.
When Lago is useful
Brume can serve models in two ways, and only one calls for billing.
With BYOK, each organisation supplies its own provider keys. The spend lands at the provider, on the account of whoever owns the key: Brume has nothing to meter and nothing to invoice. This is the default mode, and it requires none of the components described here.
With Brume Credit, the instance serves calls with its own provider access and carries the spend. It then needs to know who consumed what, on which plan, and to produce an invoice. That is Lago's job: it holds the customers, plans, subscriptions, invoices and wallets; Brume sends it measured consumption and receives its events in return.
Put plainly, Lago is only useful if someone other than you pays for the use of your instance. An internal deployment — one team, one company, its own keys — has no use for it.
Who it is aimed at
- Brume Cloud, and any instance playing the same role: serving third-party organisations and billing them for their consumption.
- An integrator hosting Brume for their own customers who wants to invoice them from the platform.
It is not aimed at a self-host deploying Brume for its own teams, nor at a BYOK instance. For those, internal spend tracking — without billing — lives in Workspace consumption and Budget and plan.
Can you leave it off
Yes, and that is the shipped state. The cut-off exists at two independent levels, and neither requires touching code.
Don't start the containers
The lago, lago-worker, lago-postgres and Redis services are all declared under the enterprise Compose profile. Without --profile enterprise on the docker compose command, they do not start: the rest of the stack runs normally. In Community Edition the question does not arise — the profile leads nowhere.
Don't configure access
On the application side, billing counts as active if and only if LAGO_API_URL and LAGO_API_KEY are both set. Emptying either one disables it, even if a Lago is running next door.
When it is inactive, the product neither breaks nor reports a misconfiguration: subscription routes refuse the request (billing not enabled), and invoice listings return an empty list. The Credit surface stays moot rather than showing up half-formed.
A third case applies to an instance that delegates its accounting to an upstream Brume gateway: if GATEWAY_BASE_URL is set, the instance keeps no local ledger and billing routes defer upstream. It needs no Lago of its own.
The variables that decide
| Variable | Role |
|---|---|
LAGO_API_URL | The Lago instance the backend calls. Together with LAGO_API_KEY, this pair is what enables billing. |
LAGO_API_KEY | The Lago API token. Emptying this variable disables billing. |
LAGO_WEBHOOK_TARGET_URL | The backend URL Lago must reach to deliver its events. Set it explicitly in production: if absent, provisioning registers no webhook rather than registering a wrong one. |
GATEWAY_BASE_URL | When set, the instance delegates accounting upstream and keeps no local ledger. |
LAGO_WEBHOOK_SECRET | Deprecated, no consumer. Leave empty — see below. |
Lago's internal secrets — the ones encrypting its own database — are a different matter and must be generated before its first start: that is covered in Enterprise with Docker Compose.
How Brume authenticates Lago's callbacks
Lago calls Brume back by webhook to report a subscription or an invoice. Those calls are verified by an RS256 JWT signature, whose public key is fetched from Lago via LAGO_API_URL and LAGO_API_KEY. There is therefore no shared secret to provision — LAGO_WEBHOOK_SECRET is a leftover.
The practical consequence is a network one: since the public signing key travels over that link, the link must be trustworthy. In-cluster HTTP between the backend and Lago is fine; on a split deployment, use HTTPS for LAGO_API_URL.
What these mechanisms do not promise
- Lago is not shipped by the Helm chart. No sub-chart deploys it: the chart expects
LAGO_API_URLandLAGO_API_KEYin the backend secret, pointing at a Lago instance you operate. The turnkey path is theenterpriseCompose profile. - Collecting payment is not Lago. Lago produces the billing; payment goes through a separate processor, set by
PAYMENT_PROCESSORand its keys. - The Lago version is pinned (
getlago/api:v1.48.1) and does not upgrade on its own. A version bump is a deliberate act, to be carried out along with its database migration. - Disabling billing does not cut the other outbound flows. The product has no global kill switch; the inventory of flows and their respective cut-offs is in External services.
What's next
- Enterprise with Docker Compose — enable the profile and pre-generate the secrets.
- Enterprise Edition — the licence without which the instance falls back to Community.
- External services — what leaves the instance, and which setting cuts it.