# x402 buyer basics

How a person or agent pays for a web request with x402 under spend limits. Dedicated spend wallet, caps before any signature, revoke or empty before debug. Buyer side only. Agent Lane does not hold keys or settle payments.

Canonical HTML: https://agentlane.net/guides/x402-buyer-basics/

## Answer first

x402 uses HTTP `402 Payment Required` so software can pay for a URL or tool. Check the quote against your caps, sign only from a dedicated spend wallet, retry with proof, keep the receipt. Do not put the main stash on the bot.

## Buyer vs seller

- **Buyer** — you or your agent pay for a request (this checklist).
- **Seller** — you charge agents for an API or page (parked here; use official seller docs if you build that yourself).

Related: [shield-crypto.md](./shield-crypto.md), [shared-box.md](./shared-box.md).

## Safe buyer path

1. Request the resource.
2. Read amount, asset, network, pay-to from the 402.
3. Compare to session max, daily max, allowed asset/network, allowlisted destinations — refuse if anything fails.
4. Sign only from the dedicated spend wallet.
5. Retry with payment proof; keep the settlement receipt.

## Spend caps and dedicated wallet

- Separate wallet for agent spend — not savings or cold storage.
- Fund only the ceiling for this day or project; refill yourself after receipts.
- Limits live in *your* code; the seller’s quote is not your budget.
- Review before place — no signature until amount, destination, and asset check out.

## Do not put the main stash on the bot

- Prefer a signer you approve over a raw key in `.env`.
- Keep keys out of chat, prompts, repos, and screenshots.
- Empty the spend wallet when the project ends.

## Revoke or cap before debug

1. Disconnect payment connectors / payer MCP.
2. Lock or sign out of agent apps.
3. Move funds off the spend wallet (or empty it).
4. Revoke grants and rotate tokens.
5. Then debug the prompt.

## Official docs (confirm live)

- [x402 protocol site](https://www.x402.org/)
- [x402 — Quickstart for buyers](https://docs.x402.org/getting-started/quickstart-for-buyers)
- [Coinbase CDP — x402 quickstart for buyers](https://docs.cdp.coinbase.com/x402/quickstart-for-buyers)

## FAQ

**What is x402 in plain words?**
x402 is an open way for software to pay for a web request via HTTP 402 with clear payment terms. Your buyer code checks terms, may sign, and retries with proof.

**Buyer vs seller?**
This page is buyer basics only. Seller / paid Agent Lane API products stay parked.

**Spend caps?**
Dedicated wallet + session/daily max + allowlisted destinations in your code.

**Main stash on the bot?**
No. A key the agent can see is a key the next prompt or leak can spend.

**Before debug?**
Revoke connectors, empty or move the spend wallet, then dig into the prompt.


Related: [agent-spend-caps.md](./agent-spend-caps.md) — hard dollar limits before any signature.

## Sources

- Canonical HTML: https://agentlane.net/guides/x402-buyer-basics/
- Related shelf: https://agentlane.net/resources/
- Site index for bots: https://agentlane.net/llms.txt

Some product links on this site may be affiliate links. They help keep these guides free. Details: https://agentlane.net/how-we-make-money/

Contact: agentlane@agentmail.to
