Internet-native payments over HTTP.
Perfect for AI agents, APIs, and content.
x402 is an open standard that brings native payments to the web by activating the long-dormant HTTP 402 Payment Required status code.
Instead of accounts, logins, or complex APIs, clients (browsers, AI agents, scripts) can automatically pay for resources using stablecoins or other on-chain assets in a single request-response cycle.
Initiates requests and handles payment logic (signing with wallet, retrying with payment header).
Protects resources. Returns 402 when payment is needed. Verifies and settles payments before delivering content.
Handles payment verification and on-chain settlement. Reduces complexity for resource servers.
sequenceDiagram
autonumber
participant C as Client
participant RS as Resource Server
participant F as Facilitator
C->>RS: GET /premium-resource
activate RS
RS-->>C: 402 Payment Required
PAYMENT-REQUIRED: base64(...)
deactivate RS
Note over C: Parses requirements
Signs PaymentPayload with wallet
C->>RS: GET /premium-resource
PAYMENT-SIGNATURE: base64(PaymentPayload)
activate RS
RS->>F: POST /verify
activate F
F-->>RS: VerificationResponse (valid)
deactivate F
RS->>F: POST /settle
activate F
F->>Blockchain: Submit transaction
Blockchain-->>F: Confirmed
F-->>RS: SettlementResponse
deactivate F
RS-->>C: 200 OK
PAYMENT-RESPONSE: base64(...)
[Resource Content]
deactivate RS
High-level flow. Facilitator is optional — servers can verify/settle directly.