What is x402 payment protocol?

Definition

The x402 payment protocol lets a server return machine-readable payment requirements with a web request. A compatible client can satisfy those requirements and continue the request, making small programmatic purchases possible without a separate manual checkout flow.

For AI agents, x402 can connect service discovery with payment. The protocol does not replace authorization, credential security, spending limits, recipient verification, or audit records, which must be enforced by surrounding trusted systems.

ELI5

The x402 payment protocol lets a website or API tell software that a resource has a price and explain how to pay in a format the software can understand. An authorized agent can pay and then try the request again with proof.

For example, a data service could request a fraction of a cent before returning one record. The agent's wallet checks the amount and recipient, makes the approved payment, and sends proof so the service releases the data.

Acronyms and aliases

HTTP 402 payment protocol variantx402 variant

Frequently asked questions

Why is x402 payment protocol useful for AI agents?

It lets software understand and satisfy a payment requirement through a structured web exchange instead of depending on a human checkout screen.

Does x402 payment protocol authorize an agent to spend?

No. It communicates payment requirements, while a separate trusted system decides whether the particular transaction is allowed.

Videos explaining x402 payment protocol

  1. How AI Agents Pay on AWS
    AI Engineer20:40