A managed wallet can pay any x402 endpoint, not just Laso’s. Pass an
external URL and Laso settles that service’s 402 challenge from the wallet.
When to use one
Good fit
Your agent runs somewhere you would rather not put a private key. You want
spending visible in a human-readable dashboard. You want one funding source
for both Laso purchases and third-party x402 services.
Poor fit
You need self-custody, on-chain control of the keys, or a spending-policy
engine richer than a per-payment cap. Use Locus, Sponge, or Ampersend
instead.
Calls
All four are Firebase callables athttps://us-central1-kyc-ts.cloudfunctions.net/<name>, authorized with the id_token from sign-in. Callables wrap arguments in a data object and wrap responses in a result object.
1
Sign in
Call
GET /auth with a SIGN-IN-WITH-X header exactly as in the
authentication guide. Save the id_token,
refresh_token, and user_id. Every call below sends
Authorization: Bearer <id_token>.2
Announce the connection
Immediately after sign-in, before reading the wallet or paying anything,
the agent should call This is what flips the dashboard’s “waiting for your agent” screen to
“connected” and records the event in the activity log. Nothing enforces it,
so a skipped announcement fails silently: the agent works fine while its
human sees no confirmation it ever connected. The reply also carries the
wallet’s funding state, so it doubles as the first
announceAgentConnection with the same id_token.getAgentWallet call.3
Read the wallet and fund it
getAgentWallet returns the wallet’s address and balance.wallet_address. When
needs_funding is true, prompting your human for a deposit is the next
step. If has_wallet is false, no wallet is provisioned yet and setup
finishes at laso.finance/agent/dashboard.4
Pay an endpoint
agentX402Pay works two ways. Name one of Laso’s own routes with route:route values are get-card, order-gift-card, order-intl-card,
get-push-to-card, and send-payment. Free endpoints are not payments and
are not routes; call those directly with your Bearer token.Or pass the full https URL of any external x402 endpoint:params become query-string arguments in either mode. Requests
default to GET; for a service expecting a POST, add "method": "POST" and a
JSON body. The response is the endpoint’s own:
{ "result": { "status": 200, "body": { ... } } }.5
Move funds out (optional)
agentWalletTransfer sends USDC from the managed wallet to any Solana
address.{ "result": { "transferId": "...", "txHash": "...", "destinationAddress": "..." } }.Guardrails for external endpoints
When you pay a Lasoroute, Laso authors the 402 challenge, so the price and the receiving address are both ours and both trusted.
An external endpoint is different: it writes the challenge, naming its own price and its own receiver. That matters more for an agent than for a person, because an agent can be steered by content it reads into calling an endpoint nobody vetted. So agentX402Pay lets you pin what you agreed to pay, and refuses anything that does not match.
All four are optional and all four only tighten.
maxAmountUsdc is bounded by a built-in $10,000 per-payment ceiling that it can lower but never raise. Asset, network, and receiver are compared case-insensitively.
If the endpoint’s challenge quotes a higher price, a different asset, another network, or a substituted receiver, the payment is refused rather than made. Pinning a price you already know is the difference between paying $0.008 and paying whatever an endpoint decides to ask for.
The cap bounds one payment, not a sequence of them. There is no per-user
velocity limit yet, so repeated calls can still add up. Set
maxAmountUsdc to the price you actually expect rather than leaving it at the
ceiling.Challenge versions
Both x402 challenge versions are supported. An endpoint may advertise its price as eithermaxAmountRequired (v1) or amount (v2), and Laso reads whichever is present. You do not need to know which version an endpoint speaks.
Seeing what was paid
Every externalurl payment is recorded and shows up in the agent’s activity list on the dashboard, settled or failed. A settled record carries the on-chain transaction signature, network, payer, and amount. A failed record carries a reason:
Payments to Laso’s own routes are not recorded here. They already appear as ordinary product activity (cards, gift cards, payouts).
Next steps
How x402 works
The underlying protocol, if you want to know what Laso is doing on your
behalf.
Making a purchase
The two-step card flow you reach through
agentX402Pay.