x402 payments
x402 is an open payment protocol built on HTTP 402 status codes. When a Prudra-protected endpoint returns 402, it includes aPAYMENT-REQUIRED header containing the payment options in base64-encoded JSON. The agent decodes this header, signs an ERC-3009 authorization off-chain, and resubmits with the signature in the PAYMENT-SIGNATURE header.
The agent’s wallet never sends a transaction directly. Prudra’s server receives the signed authorization, verifies it cryptographically, does the work, then settles on-chain. The agent pays with a signature — Prudra handles the blockchain interaction.
How the challenge works
ThePAYMENT-REQUIRED header contains a base64-encoded array of payment options:
transferWithAuthorization off-chain, and returns it as the PAYMENT-SIGNATURE header (base64-encoded).
Settlement flow
Settlement happens after your handler responds. The agent doesn’t wait for on-chain confirmation — Prudra handles that asynchronously. ThePAYMENT-RESPONSE header in the 200 response includes the txHash and a settlementPending flag.
When to use x402
x402 does not support session payments. For multi-step workflows under one payment, use MPP or session payments.
Tokens and chains
x402 currently supports:Related
- How x402 works — ERC-3009 flow in depth
- Add x402 to an endpoint — configure payMiddleware for x402
- Test x402 payments — test without real funds
- Handle the payment response — read the PAYMENT-RESPONSE header
- Dual-protocol payments — use x402 and MPP together

