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
Prepaid credits with real-time balances
Sell credits, watch them burn down live, and top up before customers hit zero.
Know every balance.
Before your customers ask.
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.
Powering fast-growing AI scaleups.And global enterprises.
See how ambitious teams build and scale their billing with Lago.
A budget per agent
Give each agent its own prepaid credits. Scope a wallet to the metrics it burns, like LLM tokens.
Every token, priced live
The Agent SDK meters each LLM call and prices it. The agent's ongoing balance follows within a minute.
Stops you control
Lago alerts you as an agent's credits run low and when they run out, so it can pause before it overspends.
Fund an agent in one command
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"
}
]
}
}Credits across every revenue workflow.From the signed quote to the final invoice.
Prepaid credits Collect upfront. Apply credits as you bill.
Quotes Fund wallets the moment the deal is signed.
Usage alerts Catch spend before the invoice.
Complex pricing & packaging Mix credits, subscriptions and usage.
Invoicing Credits applied on every invoice.
Credits & Spend Control FAQ
What is the difference between balance and ongoing balance?
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.
How do automatic top-ups work?
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.
Can I stop usage when a customer runs out of credits?
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.
Which invoices do prepaid credits apply to?
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.
When do purchased credits become available?
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.
Do credits expire?
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.
What about spend control without prepaid credits?
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.