x402 Protocol Overview
What is x402?
x402 is a payment protocol built on HTTP 402 (Payment Required). When a client requests a paid resource, the server responds with 402 and includes payment requirements in the X-Payment-Required header. The client constructs a payment proof, attaches it as the X-Payment header, and retries the request.
FluxA extends the x402 protocol to support three payment schemes — EVM (USDC on Base), Credits, and XRP — enabling AI agents to pay for APIs, MCP tools, and other resources programmatically.
Payment Schemes
| Scheme | Network | Currency | Amount Unit | Signature |
|---|---|---|---|---|
| EVM | base | USDC | 6 decimals (1000000 = 1 USDC) | EIP-712 TransferWithAuthorization |
| Credits | fluxa-monetize-credits | FLUXA_MONETIZE_CREDITS | 2 decimals (100 = 1 Credit) | EIP-712 CreditsMandateSpend |
| XRP | xrpl-mainnet | XRP | drops (1000000 = 1 XRP) | Signed XRPL Payment transaction |
All schemes use x402Version: 1 and scheme: "exact".
How It Works
- Client sends a request to a paid resource
- Server responds with HTTP 402 and
X-Payment-Requiredheader containing accepted payment schemes - Client selects a scheme, constructs a signed payment proof
- Client retries the request with the
X-Paymentheader - Server verifies and settles the payment, then delivers the resource
See Payment Flow for a detailed walkthrough.
Facilitators
Each scheme has a facilitator — a service that verifies payment proofs and executes settlement:
| Facilitator | Schemes | Settlement | Base URL |
|---|---|---|---|
| EVM Facilitator | EVM (USDC) | On-chain transferWithAuthorization on Base | https://facilitator.xechoai.xyz/ |
| Credits Facilitator | Credits | Off-chain balance debit with immutable ledger | https://walletapi.fluxapay-qa.xyz/api/facilitator |
| XRP Facilitator | XRP | On-chain XRPL Payment transaction | https://walletapi.fluxapay-qa.xyz/api/facilitator |
Credits and XRP share the same multi-asset facilitator service.
Next Steps
- Payment Flow — end-to-end walkthrough
- EVM Scheme — USDC on Base payment details
- Credits Scheme — FluxA Credits payment details
- XRP Scheme — XRP Ledger payment details
