Getlago

Credits & Spend Control

Prepaid credits with real-time balances

Sell credits, watch them burn down live, and top up before customers hit zero.

Jake Dennison's prepaid credits wallet opens with 1,000.00 credits at one dollar per credit. Usage is invoiced against the balance in real time. At 288.00 credits it drops below 300 and a low credit balance notification arrives. Under 200 credits, an automatic purchase of 812.00 credits goes pending, then its payment fails. Usage keeps going, the balance reaches zero and a credit balance depleted notification arrives. A manual purchase of 1,000.00 credits brings the balance back to 1,000.00.

Trusted by the most innovative companies

Mistral AI
PayPal
Groq
Synthesia
Laravel
Swan
Epicor
1NCE
Cerebrium
Blacksmith
Lune
OQC

Know every balance.
Before your customers ask.

Customers see what they have left.
Finance collects cash before usage, not after.

See how wallets workExplore prepaid credits
Wallet
JDJake Dennisond8588d09-78eb-4485-9e4e
Tokens1 credit = $1.00Active
Balance1,460.00 credits$1,460.00
Ongoing balance1,160.00 credits$1,160.00
ExpireNo expiration date
Total invoiced: 40.00 credits | $40.00
Activity
TransactionsAmount
Credits voidedJan. 09, 2025-15 credits$15.00
Credits invoicedJan. 09, 2025-15 credits$15.00
Manual credits purchasedJan. 09, 2025+15 credits$15.00
Automatic credits purchasedPending • Jan. 09, 2025+15 credits$15.00
Automatic credits purchasedFailed • Jan. 09, 2025+15 credits$15.00
Credits offeredJan. 09, 2025+15 credits$15.00

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.

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

Timothée Lacroix, CTO, Mistral AI

Timothée Lacroix

AI credits for your agents

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 json

The 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 & 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.

Lago solves complex billing.