We built our own x402 facilitator to give developers and users the best possible payment experience. One facilitator, six networks, zero gas fees. Here's what it does and how it works.
Why Build a Facilitator?
The x402 protocol defines three roles: the merchant (API provider), the buyer (API consumer), and the facilitator (payment verifier and settler). The facilitator is the critical piece - it verifies that a payment signature is valid, submits the transaction on-chain, and confirms settlement.
We wanted full control over this pipeline. That meant building a facilitator that handles every network we support, optimizes gas per chain, and gives us complete observability into every payment.
User -> API (HTTP 402) -> RelAI Facilitator -> verify -> settle -> done
What Makes It Different
Multi-Chain from Day One
One facilitator, one codebase, six networks:
| Network | Gas Token | Gas Paid By |
|---|---|---|
| Ethereum | ETH | RelAI |
| Polygon | POL | RelAI |
| Base | ETH | RelAI |
| Avalanche | AVAX | RelAI |
| SKALE | CREDIT | RelAI |
| Solana | SOL | RelAI |
Zero Gas Fees for Users
Our backend wallet pays gas on every transaction. The end user only needs USDC - no ETH, no POL, no SOL. They sign once, and RelAI handles everything else.
This is critical for API micropayments. If a user pays $0.01 for an API call, charging them $0.50 in gas makes no sense. By sponsoring gas, we make sub-cent payments viable on every network.
EIP-3009: One Signature, One Transaction
All EVM payments use EIP-3009 transferWithAuthorization:
- Atomic transfer - tokens move in a single contract call, no separate approve + transferFrom
- Random nonces - bytes32 random nonces eliminate ordering dependencies and replay risks
- Built for delegation - EIP-3009 was designed by Circle specifically for USDC delegated transfers
- Consistent across chains - the same signing flow works on Ethereum, Polygon, Base, Avalanche, and SKALE
transferWithAuthorization call and pays gas. Done.
Unified x402 v2 Response Format
Every network returns the same JSON structure:
{
"x402Version": 2,
"accepts": [{
"scheme": "exact",
"network": "eip155:1",
"amount": "100000",
"asset": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"payTo": "0x...",
"extra": {
"feePayer": "0x...",
"name": "USD Coin",
"version": "2",
"decimals": 6
}
}]
}
Same structure for Ethereum, Polygon, Base, Avalanche, SKALE. Solana uses the same envelope with SPL-specific fields. The frontend handles one format regardless of network.
Full Observability
Every payment step is logged and traceable:
- Authorization signature received
- On-chain verification (balance check, nonce check, deadline check)
- Transaction submission with gas estimation
- Settlement confirmation with transaction hash
When something fails, we know exactly where and why. No black boxes.
Standard x402 Endpoints
Our facilitator exposes the standard x402 API:
POST /verify- validates the payment signature off-chain (balance, nonce, deadline)POST /settle- submits the transaction on-chainGET /supported- returns supported networks, assets, and capabilities
Performance
- Verification - signatures are verified locally in milliseconds, no external API calls
- Settlement - transactions go directly to RPCs we control, with optimized gas parameters per network
- End-to-end latency - under 3 seconds on most networks, under 1 second on Solana and SKALE
- Gas optimization - per-network gas strategies keep costs minimal. On Polygon, a settlement costs fractions of a cent.
- Zero markup - no facilitator fees on top of gas. The only cost is raw gas, which we absorb.
Getting Started
For API Developers
{
network: 'base', // or 'ethereum', 'polygon', 'avalanche', 'skale-base', 'solana'
facilitator: 'relai',
pricing: {
'GET /data': { amount: '10000' } // $0.01 in USDC (6 decimals)
}
}
For Frontend / SDK Users
import { createRelaiClient } from '@relai-fi/x402'
const client = createRelaiClient({
evmWallet: {
address: userAddress,
signTypedData: wallet.signTypedData,
}
})
const response = await client.fetch('https://your-api.com/data')
// Payment handled automatically - user signs once, RelAI pays gas
Or Use a Custodial Wallet
Users without their own wallet can use RelAI's built-in custodial wallets. Fund with USDC, and payments happen automatically - no browser extension required.
Try It
Our facilitator is live at https://facilitator.x402.fi and listed in the x402 ecosystem.
Start building at relai.fi or check out our SDK documentation.
RelAI is the gas-sponsoring facilitator for the x402 payment protocol. We make API monetization frictionless by covering gas fees for end users on Ethereum, Polygon, Base, Avalanche, SKALE, and Solana.
