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 | Networks | Currency | Amount Unit | Signature | x402Version |
|---|---|---|---|---|---|
| EVM | base (mainnet), base-sepolia (testnet) | USDC | 6 decimals (1000000 = 1 USDC) | EIP-712 TransferWithAuthorization | 1, 2 |
| Credits | fluxa-monetize-credits | FLUXA_MONETIZE_CREDITS | 2 decimals (100 = 1 Credit) | EIP-712 CreditsMandateSpend | 1 |
| XRP | xrpl-mainnet | XRP | drops (1000000 = 1 XRP) | Signed XRPL Payment transaction | 1 |
All schemes use scheme: "exact".
x402Version — protocol versions
The EVM scheme accepts both protocol versions; new integrations should prefer 2.
x402Version: 1— original payload. Thenetworkfield uses the short chain name (e.g."base").x402Version: 2— same payload structure with thenetworkfield upgraded to a CAIP-2 identifier (e.g."eip155:8453"for Base mainnet,"eip155:84532"for Base Sepolia). All other fields are unchanged; existing1clients continue to work.
The Credits and XRP schemes currently use x402Version: 1 only.
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 | Networks | x402Version | Settlement | Base URL |
|---|---|---|---|---|---|
| Base USDC Facilitator | EVM (USDC) | base (mainnet), base-sepolia (testnet) | 1, 2 | On-chain transferWithAuthorization on Base | https://facilitator.fluxapay.xyz/ |
| Credits Facilitator | Credits | fluxa-monetize-credits | 1 | Off-chain balance debit with immutable ledger | https://walletapi.fluxapay-qa.xyz/api/facilitator |
| XRP Facilitator | XRP | xrpl-mainnet | 1 | On-chain XRPL Payment transaction | https://walletapi.fluxapay-qa.xyz/api/facilitator |
The Base USDC Facilitator at facilitator.fluxapay.xyz is FluxA's production x402 settlement endpoint for USDC on Base. It is registered on x402scan and is currently the most active non-Coinbase x402 facilitator on Base by daily transaction count. It covers gas on the user's behalf and submits EIP-3009 transferWithAuthorization transactions, so funds settle directly user → user.
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
