Pay an agent credit top-up with x402
Adds USD credit through an x402 USDC payment on Solana. Reuse the same request body and Idempotency-Key when submitting payment.
Access: API key: billing:write · Session: any role, own account.
- The first request returns
402withPAYMENT-REQUIRED. Authorize that exact payment, then repeat withPAYMENT-SIGNATURE. 201means finalized receipts have credited the wallet.202is still pending: poll the payment or replay this request.- API keys fund their creator. The account must be eligible for funding, and configured top-up limits apply.
- The small fractional attribution amount is retained as credit. Use the offered network, USDC mint, fee payer and reference.
- You can have at most 5 unpaid crypto top-ups at a time and start 20 in 24 hours; beyond that the request returns
409 quota_exceeded. - Supports regular-wallet USDC transfers with the offered memo and bounded compute instructions. Smart wallets and address lookup tables are not supported.
- If funding or verification is unavailable, new submissions return
503. Check receipts before replacing an expired payment. - See the agent payment guide for the full flow.
AuthorizationBearer <token>Send Authorization: Bearer <token>. A token is an API key (lb_live_…, scoped, for programs) or a session (lb_sess_…, from signup or login, for people). See Authentication above.
Idempotency-Key*stringPersist one identity for the entire funding attempt and every retry, across workspaces.
1 <= length <= 128X-Org-ID?stringSessions only: act on this organization (you must be a member). Default: your first organization.
PAYMENT-SIGNATURE?stringBase64-encoded x402 V2 PaymentPayload with the partially signed Solana transaction. Never log this authorization.
length <= 16384application/json- body
amount*UsdStringUSD amount, parsed as integer cents without rounding.
^[0-9]+([.][0-9]{1,2})?$Finalized receipts have credited the authenticated user's personal wallet. A replay returns the original payment.
application/json- response
credit?display_idr_per_usd?stringImmutable original rate for displaying this USD credit in IDR. Omitted on legacy instructions or when unconfigured.
^[0-9]+$instructions_version?1Immutable instruction snapshot version; legacy rows may omit it.
1id*stringpurpose*stringNew intents are top-ups. The legacy vm_purchase value remains readable for historical records.
"vm_purchase""topup"method*stringusdc_tempo is used only by MPP agent top-ups.
"usdc_solana""usdc_arc""usdc_tempo"status*stringawaiting: nothing received. partial: some received. paid: complete. expired/canceled: closed (anything received is wallet balance).
"awaiting""partial""paid""expired""canceled"vm_id*|Null for new top-ups; retained only for historical direct-payment VM orders.
amount*received*What has arrived so far.
pay_to*stringThe address to pay on the stated network.
reference*|Solana only: a unique reference key that identifies this payment (already inside payment_uri).
payment_uri*stringA link/QR payload for wallets: Solana Pay on Solana, an EIP-681 request on Arc.
network*expires_at*stringPay before this time.
date-timepaid_at*|date-timecreated_at*stringdate-timetransactions*array<>On-chain transfers credited to this payment, oldest first. Empty until a transfer is credited.
curl -X POST 'https://layerbeat.com/v1/billing/top-ups/x402' \ -H 'Idempotency-Key: agent-topup-20261006-01' \ -H 'PAYMENT-SIGNATURE: eyJ4NDAyVmVyc2lvbiI6Mn0=' \ -H 'Content-Type: application/json' \ -d '{ "amount": "5.00"}'{ "id": "pay_h3x9k2m7q4w6z8tfjn5r2bcdva", "purpose": "topup", "method": "usdc_solana", "status": "paid", "vm_id": null, "amount": { "usd": "5.00", "usdc": "5.003417" }, "received": { "usdc": "5.003417", "credited_usd": "5.00" }, "pay_to": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU", "reference": "J4Zq9mTt8Yd3nVwKpL2xRfH6bCsUeA5gQj7oWz1NhXy", "payment_uri": "solana:7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU?amount=5.003417&spl-token=4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU&reference=J4Zq9mTt8Yd3nVwKpL2xRfH6bCsUeA5gQj7oWz1NhXy&label=VPS", "network": { "name": "USDC on Solana (devnet)", "network": "solana-devnet", "asset": "USDC", "contract": "4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU", "decimals": 6 }, "expires_at": "2026-10-06T11:00:00Z", "paid_at": "2026-10-06T10:01:00Z", "created_at": "2026-10-06T10:00:00Z", "transactions": [ { "id": "5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW", "explorer_url": "https://solscan.io/tx/5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW" } ]}