x402 Payments for AI Agents: Pay Per API Call
How x402 payments help AI agents buy individual API calls. Learn the payment flow, facilitator role, spending limits and safe retry practices.

An AI agent can find a useful API in seconds. Paying for one result can take much longer if the service expects a person to create an account, choose a subscription and set up billing first. x402 offers another route: payment requirements become part of the HTTP conversation between the buyer and the service.
That makes it possible to design services around individual requests, rather than requiring every occasional user to become a subscriber.
What happens in an x402 payment?
A client asks for a protected resource. The server returns HTTP 402 Payment Required with the payment terms. In the x402 v2 flow, the PAYMENT-REQUIRED header carries those requirements. A compatible client checks the terms and submits a payment payload using PAYMENT-SIGNATURE.
The server then handles verification and settlement according to its supported scheme. On successful delivery, the buyer receives the resource and payment-response information. A developer should follow the provider’s exact integration guide rather than assuming every implementation supports the same networks, tokens or headers.
A practical example: one useful lookup
Imagine an assistant preparing a company briefing. Most of its sources are freely available, but it needs one specialist data result. A seller could price that result at 0.01 USDC. That figure is an illustration, not a universal x402 price.
The assistant should compare the quoted cost with its budget before authorizing anything. The user can then pay for a small piece of work without committing to a recurring subscription for that service.
What does the facilitator do?
A facilitator can check that the submitted payment payload matches the seller’s requirements and submit settlement to the supported blockchain. The resource server still controls its own product and delivery. Developers can also implement verification and settlement themselves.
Choosing a provider therefore means checking network coverage, integration requirements and operational support. A protocol-compatible payment is only one part of a useful paid API.
Put limits around autonomous spending
Before enabling purchases, define a maximum price per request, an overall spending budget and the services the agent may use. Store payment references alongside the request and delivery result so support can investigate problems without asking for private keys or reusable authorizations.
A timeout is especially important. It does not establish that payment failed. Check the existing settlement and the provider’s recovery process before creating a fresh payment. Otherwise a network interruption could become an unnecessary second charge.
Measure useful delivery
A 402 response shows that a service is asking for payment. It does not prove that a purchase happened. A settlement proves that funds moved, while successful delivery requires evidence that the requested result was returned. Keeping these events separate makes activity reporting more useful to both buyers and sellers.
Explore listed services: https://x402blockchains.com/ai-agents-apps/
Sources:
https://docs.x402.org/introduction
https://docs.x402.org/core-concepts/facilitator
https://docs.x402.org/core-concepts/client-server