Lago has been able to follow the pace of our releases and has allowed us to focus on what we do best.

Credits & Spend Control
Sell credits, watch them burn down live, and top up before customers hit zero.
Customers see what they have left.
Finance collects cash before usage, not after.
Real-time credit balances.Every balance follows current usage, taxes and draft invoices, refreshed every minute. Customers see it in the portal.
See how ambitious teams build and scale their billing with Lago.
Lago has been able to follow the pace of our releases and has allowed us to focus on what we do best.

Give each agent its own prepaid credits. Scope a wallet to the metrics it burns, like LLM tokens.
The Agent SDK meters each LLM call and prices it. The agent's ongoing balance follows within a minute.
Lago alerts you as an agent's credits run low and when they run out, so it can pause before it overspends.
Create an agent's wallet from the API, the CLI or MCP, with its credits and an automatic top-up. Your agents can check their own balance too.
Create a prepaid credits wallet for an AI agent with the Lago CLI:
lago wallets create --input @agent-wallet.json --output jsonThe research agent's wallet holds 500 credits. Whenever its ongoing balance drops below 50 credits, Lago tops it back up to 500.
{
"wallet": {
"external_customer_id": "research_agent",
"name": "Agent budget",
"credits_ongoing_balance": "500.0",
"recurring_transaction_rules": [
{
"trigger": "threshold",
"method": "target",
"threshold_credits": "50.0",
"target_ongoing_balance": "500.0"
}
]
}
}




The balance is invoiced: the prepaid credits left in the wallet, updated each time an invoice is finalized. The ongoing balance subtracts current usage, taxes and draft invoices from it, so it shows what the customer has really left. It refreshes every minute and whenever an invoice is finalized. Real-time balances are a premium feature.
A wallet can carry recurring top-up rules. A rule triggers on an interval (weekly, monthly, quarterly, semiannual or yearly) or when the ongoing balance drops below a credit threshold. It either adds a fixed number of credits or tops up to a target balance, buying exactly the difference. Top-ups can mix paid and granted credits, and each rule can have its own expiration date.
Lago tells your product when to act, and your product enforces access. Credits consumption alerts fire an alert.triggered webhook as the balance or ongoing balance crosses up to 20 decreasing thresholds, each with a code such as soft or hard. The wallet.depleted_ongoing_balance webhook fires when the ongoing balance reaches zero or goes negative.
Credits apply to subscription and progressive billing invoices in the wallet's currency, after tax and after any credit notes. They don't apply to one-off invoices. A customer can hold up to 5 active wallets, each scoped to fee types or billable metrics and applied in priority order from 1 to 50.
Granted credits land instantly. Purchased credits land once payment succeeds, whatever the invoice's payment terms. You choose per wallet, rule or transaction whether the top-up invoice is issued right away or only after a successful payment. Credit purchases are advance payments, so they aren't taxed and coupons don't apply.
Not by default: credits roll over from period to period until the balance reaches zero. Set an expiration date and Lago voids the remaining credits when it's reached. You can also void an exact number of credits or terminate a wallet at any time.
Usage alerts fire when a subscription's current or lifetime usage crosses thresholds you set, per subscription or per billable metric. Progressive billing, a premium add-on, invoices as lifetime usage reaches each threshold, so large balances are collected before they build up.