What problem does it solve?
x402 solves the problem of how AI agents reliably pay for HTTP-accessible services without requiring API keys or subscription setups.
Core Features & Use Cases
- HTTP-native micropayments: Agents pay for endpoints using an HTTP
402 Payment Required challenge/response flow.
- Signed payment authorizations (EIP-712): Each request includes an
X-402-Payment header carrying an EIP-712 signature to prove intent and prevent tampering.
- Server-side verification & conditional serving: Servers verify signatures and only serve premium content when payments are valid.
- On-chain settlement, batched for efficiency: Payments settle on-chain after validation, improving trust and auditability.
Use case: An agent requests market data from a paid endpoint; the server replies with pricing, the agent signs and retries with X-402-Payment, and the server serves the result only after verifying the authorization.
Quick Start
Use the x402 protocol flow by having your paid server respond with 402 and validate the incoming EIP-712 signed X-402-Payment header before serving the requested resource.