How an x402 payment works
The basic pattern is a normal web request that turns into a payment request only when the resource requires payment.
- Request A buyer, app, script, or AI agent requests an API, file, model response, dataset, or content resource.
- 402 response The server responds with HTTP 402 Payment Required and includes payment instructions instead of serving the resource immediately.
- Payment payload The client prepares a payment payload using the supported asset, network, amount, recipient, and scheme.
- Verify and settle The seller verifies the payment directly or uses a facilitator to verify and settle the payment.
- Resource release If payment is valid, the server returns the protected response, API result, file, or service output.