Draft:HTTP X402


HTTP x402

[edit]

x402 is an open protocol for embedding digital payments into HTTP interactions using the long-reserved HTTP status code 402 Payment Required. The protocol is designed to enable programmatic, machine-to-machine payments for web resources such as APIs, digital content, and automated services. x402 was introduced in 2025 and is primarily associated with work by Coinbase and collaborators, with stewardship later transferred to the independent x402 Foundation.

x402 is not an Internet Engineering Task Force (IETF) standard, but is published as an open specification and implemented through open-source software.

x402
Developerx402 Foundation
Initial release2025
Written inTypeScript
Python
LicenseOpen standard
Websitehttps://www.x402.org

Background

[edit]

The HTTP 402 Payment Required status code has existed since early versions of HTTP but was historically unused due to the lack of a standardized payment mechanism. Over time, most monetization on the web relied on external systems such as subscriptions, advertising, or centralized payment processors.

The emergence of blockchain-based settlement systems, particularly stablecoins with low transaction fees, renewed interest in implementing HTTP-native micropayments. x402 was proposed as a protocol to operationalize HTTP 402 by defining a structured payment negotiation and settlement flow between clients and servers.

Design goals

[edit]

The x402 protocol is designed around several core principles:

  • HTTP-native operation, integrating directly into standard request–response flows
  • Open standard governance, without reliance on a single vendor or platform
  • Chain- and asset-agnostic design, supporting multiple blockchain networks and payment methods
  • Minimal integration overhead, intended to require limited changes for clients and servers
  • Support for automated agents, including non-human clients such as AI systems

Protocol overview

[edit]

x402 operates as a payment negotiation layer on top of HTTP. When a client requests a protected resource, the server may respond with a 402 Payment Required status code and include structured payment requirements describing acceptable payment methods.

A typical x402 interaction follows this sequence:

  1. A client makes an HTTP request to a resource server.
  2. The server responds with HTTP 402 and a machine-readable payment requirement.
  3. The client constructs a payment authorization payload corresponding to one of the accepted options.
  4. The client re-issues the request including the payment authorization in an HTTP header.
  5. The server verifies the payment, either locally or via a facilitator service.
  6. Upon successful verification and settlement, the server returns the requested resource with an HTTP 200 response.

The protocol separates payment authorization, verification, and settlement to allow flexibility in payment execution and to reduce client-side complexity.

Roles

[edit]

x402 defines several functional roles within a transaction:

  • Client – the entity requesting a resource and initiating payment
  • Resource server – the HTTP server providing a paid resource
  • Facilitator – an optional service that verifies and executes payments on supported networks

Facilitators may handle blockchain interactions such as submitting transactions and waiting for confirmation, while being cryptographically restricted from altering payment intent.

Payment schemes and networks

[edit]

x402 distinguishes between schemes and networks:

  • A scheme defines the logical payment behavior (for example, exact payment for a single request).
  • A network specifies the underlying settlement system, such as a particular blockchain.

This separation allows the same scheme to be implemented across different networks and enables extensibility for future payment models.

Versions

[edit]

Version 1

[edit]

The initial version of x402 focused on single-request, exact-amount payments settled immediately, primarily using blockchain-based stablecoins.

Version 2

[edit]

x402 Version 2 expanded the protocol to support:

  • Wallet-based identity and reusable access sessions
  • Automatic service discovery
  • Dynamic payment recipients
  • Modular extensions and plugins
  • Alignment with modern HTTP header conventions

Version 2 retained backward compatibility with earlier implementations.

Use cases

[edit]

Proposed and early use cases for x402 include:

  • Pay-per-request web APIs
  • Micropayments for digital content
  • Automated payments by AI agents
  • Metered access to computational or data services
  • Machine-to-machine commerce without prior contractual relationships

Because x402 is not standardized by the IETF, adoption remains voluntary and implementations vary.

Ecosystem

[edit]

The x402 ecosystem includes open-source reference implementations, client and server libraries, facilitator services, and exploratory tools. One such tool is x402scan, a web-based explorer designed to index and visualize publicly accessible x402-enabled resources.

The ecosystem is coordinated through the x402 Foundation, which maintains the protocol specification and encourages third-party contributions.

Standardization status

[edit]

x402 is not an official HTTP standard and is not defined in any IETF Request for Comments (RFC). It exists as an experimental, open protocol implemented by participating clients and servers. Its long-term status depends on adoption and potential future standardization efforts.

See also

[edit]

References

[edit]

Cite error: A list-defined reference has no name (see the help page).