Skip to content
Back to news

x402: bots that pay per request

A new x402 Payments Agent template and five skills: a bot finds a pay-per-call API, pays a few cents inside your rules, and shows the receipt.


Some APIs no longer want an account or a key. They want a few cents for each request, paid when the request is made. x402 is how they ask.

x402 in one paragraph

A service answers HTTP 402 Payment Required, with its price in a PAYMENT-REQUIRED header. The client signs a USDC authorization (EIP-3009 transferWithAuthorization) and sends the request again with it in PAYMENT-SIGNATURE. A facilitator checks it and settles it on chain, and the answer comes back with the settlement in PAYMENT-RESPONSE. No account, no API key.

In Lobstack

A bot's paid_fetch takes the same three steps as every payment it makes, which Plan, Act, Verify describes:

  • Plan: it reads the price from the 402, signs the authorization on your computer, and simulates exactly the transfer the facilitator would make with it.
  • Act: inside the rules, a small payment goes ahead; a bigger one asks you. Only the planned payment can be sent.
  • Verify: it reads the settlement from PAYMENT-RESPONSE, checks it on chain against the plan, and returns the answer with its receipt.

find_paid_services searches the x402 Bazaar, the index of x402 services, and lists the ones that accept Monad first. On Monad testnet the facilitator is Monad's own.

The template and the skills

The x402 Payments Agent template is under Money in and out. It finds pay-per-call APIs, pays for them from its own wallet, and reports each answer with its price and a link to the transaction. It needs Agent Payments, in Labs.

Five new skills sit on a Payments & x402 shelf: find a pay-per-call API, pay for an API call with x402, send a USDC payment (Plan, Act, Verify), reconcile a bot's payments, and suggest a bot's spending rules. The first never pays, the fourth only reads, and only you can change the rules the fifth suggests.

What testnet means here

Most services listed on the Bazaar settle on mainnet. On testnet a bot pays test endpoints, such as one you run yourself: scripts/x402-demo-seller.mjs in the app's repository serves one. Test money only.

All of it is in 0.11.8, at /download.


All posts