Skip to main content

Balance and payment fallback

Each account has one USD balance that every key draws on. Anyone can top it up with USDC through a standard 402 exchange, with no Lasso credential. If your account has paid before and the money runs out, your app keeps serving on public providers for 30 days while you top up.

Where premium requests are paid from

For a request on premium, Lasso takes the first source that applies: A provisional account that has never paid has only its starting grant: once it’s spent, requests return balance_exhausted until someone tops it up.

Your app keeps serving when the balance runs out

Say your indexer’s balance hits zero at 3 a.m. Its requests keep succeeding, now on public providers, load-balanced, at 30 RPS:
The account view shows when the grace window ends in fallback.until. Open WebSocket subscriptions keep streaming from the upstreams they’re on. Top up, and the next request is served by premium providers again, with no reconnect and no redeploy.

Top up

Credit the account. Lasso answers 402; its offer.rails lists the rails that accept this amount, each with a challenge: x402 in PAYMENT-REQUIRED, MPP in WWW-Authenticate: Payment.
  1. Sign one challenge with a standard x402 or MPP client and the payer’s wallet.
  2. Repeat the same request with PAYMENT-SIGNATURE (x402) or Authorization: Payment (MPP).
  3. 200 returns credited_usd, balance_usd and a receipt. 202 means settlement is pending: poll its status_url, and never sign a second payment for the same top-up.
With @x402/fetch, the whole exchange is one call. Run it as an ES module with @x402/fetch, @x402/evm and viem installed, a funded Base USDC wallet in PAYER_PRIVATE_KEY, and the account in LASSO_ACCOUNT_ID:
mppx does the same over MPP on Tempo. Resubmitting the same signed payment returns that payment’s result and never credits twice. Rails, networks, assets and the per-purchase range (minimum_usd to maximum_usd) are in account_payments.rails in agent.json. People can also subscribe in the dashboard.

Watching spend

Limits

  • The grace window lasts 30 days from when paid spending power runs out, and restarts every time the account pays.
  • Payment fallback serves public providers at the public rate limit (30 RPS, bursts to 60) with load-balanced only.
  • x-lasso-balance-usd is an estimate at the region that served you; GET /api/v1/accounts/{id} is authoritative. Concurrent traffic can take a balance slightly below zero; the next top-up repays it first.
  • When the grace window ends without a top-up, open WebSocket connections close with balance_exhausted and the credit URL.
  • The management token can’t pay. Every purchase needs a wallet signature.

Next