EDITORIAL ARTICLE
x402 Explained: How an Agent Can Pay for an API Request
Project reference · x402 ↗A research agent wants a single data query. The service charges for access, but the agent has no subscription. x402 describes a way for a server and client to exchange payment requirements and payment information as part of accessing a resource.
The following is a conceptual example, not a live transaction. Exact steps and supported payment schemes depend on the implementation.
What happens in the example?
- The client requests a protected resource.
- The service responds with payment requirements, such as an accepted scheme and amount.
- The client prepares a payment payload using a compatible payment mechanism.
- The client sends the request with that payload. The service verifies and processes it according to its implementation, potentially using a facilitator.
- The service delivers the resource when its conditions are met.
The x402 HTTP transport specification describes the HTTP interaction; the protocol specification describes the broader roles and structures. Verification, settlement and delivery order must be checked against the specific implementation.
| Component | Its question |
|---|---|
| User or policy | Is this agent allowed to spend? |
| Wallet | How can an authorized payment be signed or made? |
| x402 | How are payment requirements and payment information exchanged? |
| Service | What is sold and when is it delivered? |
What x402 does not decide
It does not automatically set the user’s budget or determine whether a purchase is worthwhile. It also does not by itself guarantee a refund, service quality, or safe handling of every timeout. Check the service’s terms, total cost, supported network, and retry behavior before relying on a real integration.
For the broader journey, read What Is Agentic Payment? and What Is an Agent Wallet?. Sources reviewed 2026-10-30; no live payment was performed.