How paying a bot works
A bot pays the way a browser loads a page: ask, get a price, pay, ask again.
The steps
- Ask. The agent calls the seller's endpoint.
- Get a price. The seller answers
402 Payment Requiredwith its terms: amount, token, network and the payTo address. - Decide. The agent's wallet or payment library compares the terms with its own limits.
- Pay. If the terms are OK, the agent signs a payment and sends the request again with it attached.
- Settle. The seller, or its facilitator, checks the payment and settles it.
- Get the answer. The seller sends the response, often with a settlement or receipt header.
What to check before signing
The MPP spec says clients must check four things before they authorize a payment, and the same list works for x402:
- the amount is reasonable for what you're buying;
- the recipient (payTo) is the one you expect;
- the currency or token is the one you expect;
- the time window is sensible.
It also warns not to trust the seller's description text. A misleading description can sit next to a payment request for a different amount.
Set a per-payment cap. Common x402 clients cap single payments by default (for example, @x402/fetch's maxAmountPerPayment), so the agent stops instead of paying an unexpected price.
Why checking first matters
Many x402 stablecoin payments settle as on-chain transfers, which usually cannot be reversed the way a card chargeback can. Some x402 schemes authorize first and settle later (see Payment Headers in V2 / batch settlement). If a seller sends money back, that is a separate payment. Stripe machine payments are different: refunds go through Stripe's Refunds API (Stripe docs). Either way, the cheapest mistake is the one you avoid before you sign.
What can go wrong
- Price drift: the price asked is higher than the listing said.
- payTo change: the payment address changed since last time (what that can mean).
- Paid, nothing useful back: the payment settled but the response was empty or wrong.
- Not answering: no valid 402, a timeout or an error.
BotsRated records the first, second and fourth on every unpaid check. Our capped test purchases record the third. How to check a seller.
For bots
- Before paying, free:
GET https://botsrated.com/v1/preflight?url=<host>(1000 per client IP per UTC day). MCP toolpreflightwith{"url":"<host>"}. - In code: Guard,
createPaymentGuardin npm@botsrated/x402-preflightorPaymentGuardin PyPIbotsrated(docs). It compares the 402 you got with what we last measured. - Compare
latest_probe.live_amount,live_payTo,live_assetandlive_networkwith the 402 in front of you, and readfreshness.stale.
Full field list: /llms.txt · /openapi.json · MCP endpoint POST https://botsrated.com/mcp (Streamable HTTP, no login).
Sources
- x402 docs: How does it work, x402 docs: HTTP 402
- mpp.dev: Protocol overview (Security considerations: amount verification, “Don't trust descriptions”)
- Stripe docs: Machine payments (refunds through the Refunds API)
- Client caps and our fields: /llms.txt
Educational information about how payments and measurements work, not legal, tax or financial advice.
Next: How to check a seller before paying · All lessons · Guides · Docs