Understanding x402 conceptually is one thing. Actually sending a payment is another. This walks through what you need before you can pay your first x402-gated request, whether you're doing it manually to test something or setting up an AI agent to do it autonomously.
Send a normal request to the endpoint, the same way you'd call any API. You'll get back a 402 response rather than the content.
The 402 response includes the price, the accepted token, the network, and the address to pay. Confirm these match what you expect — particularly the network, since paying on the wrong chain sends funds nowhere useful.
Using your wallet or a client library that implements the x402 client side, sign a payment matching those exact terms. Most implementations handle this with a software library rather than you manually constructing a transaction.
Resend the same request, this time with the signed payment included in the appropriate header. The resource server (or its facilitator) verifies it and, if valid, returns the actual content with a 200 OK.
For an agent to do this autonomously, it needs three things: a wallet it can sign with programmatically (not a browser extension waiting for a human click), enough USDC funded to cover its expected usage, and client-side x402 support built into whatever framework or library it's running on. Several agent frameworks have added x402 client support as a built-in capability, meaning you configure a wallet once and the framework handles the 402-detect-and-pay loop automatically on every request that needs it.
The practical risk to manage here isn't the protocol — it's giving an autonomous agent unsupervised spending power. Reasonable safeguards include funding the agent's wallet with only what you're comfortable losing, setting a maximum price the agent will pay per request without escalating to a human, and monitoring the wallet's transaction history rather than assuming it's behaving as expected.
This is general technical guidance, not financial advice. Always verify current integration details with the specific wallet, library, or facilitator you're using before sending real funds.