Guide
x402 buyer basics
Some links may earn us a commission at no cost to you, which helps keep these guides free and up to date.
x402 lets software pay for a web request. Pay only from a dedicated spend wallet, enforce a cap before any signature, and revoke or empty that wallet before you debug. Buyer side only — Agent Lane does not hold keys or settle payments.
By Agent Lane Editorial · Page dated 25 September 2026
What this page is
A short buyer checklist for people who let Cursor or Grok pay for a web page, MCP tool, or other paid endpoint over x402. It sits beside the crypto spend shield: that guide covers the wallet and key hygiene; this one walks the payment request itself. Pair both with the shared-box checklist when the agent runs on a shared computer.
Seller rails and any paid Agent Lane API product stay parked. We publish the buyer checklist; we do not host your wallet or your endpoint.
What x402 is (plain words)
x402 is an open payment method that uses HTTP 402 Payment Required. A client asks for a resource. If payment is due, the server answers 402 with clear terms: amount, asset, network, pay-to address, scheme. Your code checks those terms against limits you set. If they pass, a local signer builds a payment message; a facilitator (payment helper) may submit the on-chain transfer. The client retries the same request with the payment proof. A successful response includes a settlement receipt.
No money should move until the retry you approved. The seller’s 402 is a quote, not a command. “Gasless for the agent” does not mean free or unlimited — the spend is the asset you authorized.
Recommended next step.
- Coinbase Developer Platform (CDP) — x402 buyer quickstart and a dedicated server wallet for agent payments
Buyer vs seller
- Buyer. You or your agent pay for a request. This guide.
- Seller. You charge agents for a callable job. Out of scope here — use official seller quickstarts only if you build that yourself later.
Both sides still need a spend shield: dedicated wallet, caps, review before place, keys off chat.
Safe buyer path
- Request the resource. Your agent or client requests a URL or paid tool.
- Read the 402 terms. If payment is required, read amount, asset, network, pay-to, and scheme from the 402 response.
- Check your caps. Compare the quote to your session max, daily max, allowed asset, and allowlisted destinations. Refuse and stop if anything fails.
- Sign only if it passes. A local signer builds the payment message from the dedicated spend wallet — never from your main stash.
- Retry with proof. Retry the same request with the payment proof. Keep the settlement receipt. A session without a receipt is unfinished.
Automatic pay-on-402 tools are easy to leave wide open. If your client will pay without asking, the only real brakes are the wallet balance and the limits in your code. Set both before the first live call.
Spend caps and a dedicated wallet
Operator deep-dive on hard dollar limits (caps vs permissions vs review): Agent spend caps.
- Separate wallet. Agent spend gets its own wallet — not savings or cold storage.
- Fund the ceiling. Put in only what you can afford to lose for this day or project. Refill yourself after you read the receipts.
- Limits in your code. Session max and daily max, allowed asset and network, allowlisted destinations only.
- Review before place. No signature until you have looked at amount, destination, and asset — or until a rule you wrote and understand has checked them.
Full wallet and key hygiene: Shield crypto spend.
Do not put the main stash on the bot
Do not point an agent at the wallet that holds savings, payroll, or keys you would mourn. Prefer a signing service or hardware wallet you approve over a raw key in .env. If a key must live on the computer, keep it out of chat, prompts, repos, and screenshots.
A key the agent can see is a key the next prompt, log, shared user, or leaked chat can spend. Treat “the model needed the key to sign” as a last resort.
Revoke or cap before you debug
Full incident order: Revoke before you debug.
- Disconnect payment connectors and any payer MCP from Cursor and Grok.
- Lock or sign out of the agent apps on that computer.
- Move leftover funds off the spend wallet to a wallet the agent cannot sign — or empty it.
- Revoke login grants and rotate tokens that lived beside those connectors.
- Only then dig into the prompt. Debugging while the pipe is still open is how a second payment lands.
Shared computer, connectors, and passwords: Write invalidation before entryReject duplicate place same thesisConfirm symbol before placeNo scale-in without GOFlatten all before connector revokeOne order per idea until fillNo place while unconfirmed fillWrite max loss before entryShared-box and connector checklist.
A first live path (still DIY)
- Start on a test network with the official buyer quickstart — package names change; copy them from the docs.
- Point the signer at the dedicated spend wallet.
- Hard-code a tiny max amount and a single allowed URL.
- Complete one paid call. Read the receipt. Then decide whether a second URL is worth opening.
Start the buyer path.
- Coinbase Developer Platform (CDP) — dedicated spend wallet + x402 buyer tooling
- Keep the main stash on Ledger or Trezor
What Agent Lane does not do here
- We do not hold your keys, run a hot wallet, or settle payments.
- We do not publish a funded “agent buyer” for live APIs.
- We do not sell or host a paid x402 seller/API product on this site (parked).
Official product links
Official docs that match this guide. The wider product shelf lives on Resources; compensation rules on How we make money.
- x402 protocol site
- x402 — Quickstart for buyers
- Coinbase CDP — x402 quickstart for buyers
- Related: Revoke before you debug
- One connector at a time
- Fund the session ceiling
- Related: Shield crypto spend
- Related: Shared-box checklist
- More on Resources
Sources
x402 buyer quickstart, docs.x402.org, and Coinbase Developer docs on how x402 works, checked against public pages for this guide dated 25 September 2026. Header names and libraries change — use the live docs when you build.
FAQ
- What is x402 in plain words?
- x402 is an open way for software to pay for a web request. When a URL or tool needs payment, the server answers with HTTP 402 Payment Required and clear terms (amount, asset, network, pay-to). Your buyer code checks those terms, then may sign and retry with payment proof. It is not a bank account, not a brokerage, and not Agent Lane hosting a wallet.
- Buyer vs seller — which side is this guide?
- Buyer means you (or your agent) pay for a request. Seller means you charge agents for an API or page. This page is buyer basics only. Seller and paid Agent Lane API products stay parked. For wallet and key hygiene that still applies on both sides, see the crypto shield and shared-box guides.
- How do spend caps and a dedicated wallet work?
- Give the agent a wallet that holds only spending money — not savings or cold storage. Fund it with the ceiling for this day or project. In your buyer code, refuse any 402 quote over your session max or daily max, on the wrong asset, or to an unknown URL. The seller’s quote is not your budget.
- Why not put the main stash on the bot?
- A key the agent can see is a key the next prompt, log, shared user, or leaked chat can spend. Keep long-term holds and personal keys outside the spend shield. Prefer a signer you approve over a raw key in .env. Empty the spend wallet when the project ends.
- What should I revoke or cap before debugging?
- Disconnect payment connectors and MCPs first. Lock or sign out of the agent apps. Move leftover funds off the spend wallet to a wallet the agent cannot sign. Cap or empty the wallet before you dig into a bad prompt. Debugging while the pipe is still open is how a second payment lands.
- Where are the official docs?
- Start with the x402 buyer quickstart and Coinbase CDP x402 buyer quickstart linked at the bottom of this page. Header names and package names change — copy them from the live docs, not from memory. Agent Lane does not hold keys or settle payments.
Next steps
Before an agent touches real money, give the agent its own dedicated wallet, set hard spend caps, and shield your crypto. Or browse all Agent Lane guides.
Get the daily roundup
The day’s useful AI agent news for small businesses, in plain language, by email. Free.