How It Works
- Agent sends a request without a payment proof
- Gateway checks for a PayStream session credit — if available, debit and proceed
- If no session, returns HTTP 402 with payment options (one per chain per facilitator)
- Agent selects a chain, pays USDC on-chain, retries with proof header
X-Payment-Proofcarries the tx hash;X-Payment-Chainspecifies the chain- SpentProofsStore prevents replay (10-minute TTL)
- Facilitator verifies the payment
- If overpayment occurs, excess becomes PayStream session credit
Supported Chains
| Chain | Type | USDC Address |
|---|---|---|
| Base | EVM | 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 |
| Ethereum | EVM | 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 |
| Arbitrum | EVM | 0xaf88d065e77c8cC2239327C5EDb3A432268e5831 |
| Optimism | EVM | 0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85 |
| Polygon | EVM | 0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359 |
| ApeChain | EVM | 0xA2235d059F80e176D931Ef76b6C51953Eb3fBEf4 |
| Monad | EVM | 0x754704Bc059F8C67012fEd69BC8A327a5aafb603 |
| Solana | Solana | EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v |
| Sui | Move | 0xdba34...::usdc::USDC |
Using @lucid-fdn/pay
The@lucid-fdn/pay package provides a drop-in fetch() wrapper that auto-handles 402 responses:
Enabling Payments (API Providers)
API providers enable x402 on their tenant via the control plane:Key Features
| Feature | Description |
|---|---|
| PayRoute | Intelligent multi-facilitator routing — weighted scoring (gas 40%, latency 30%, success 20%, preference 10%) |
| PayStream | Session credit balances — deposit once, call many times with zero per-call gas |
| PayCascade | Composable multi-hop revenue pipelines — BPS-based splits across model/compute/tool/protocol |
| PayReputation | Agent credit scoring from receipt history — tiers: unverified, bronze, silver, gold, platinum |
| Zero-Config | One API call enables payment enforcement on all routes |
Facilitators
| Facilitator | Chains | Method |
|---|---|---|
| Direct | Base, Monad | On-chain EVM RPC (eth_getTransactionReceipt) |
| Coinbase | EVM | Coinbase x402 API |
| PayAI | Base, Ethereum, Arbitrum, Solana, Monad | PayAI API + RPC fallback |
| Sui | Sui | Sui RPC verification |
| Thirdweb | 14 EVM chains | Thirdweb API + ERC-3009 signed authorizations |
.png?fit=max&auto=format&n=VsjUqn6fLqEhBiuI&q=85&s=8b4c7e6431e9a6af1ef23b77bb4ff5fd)
.png?fit=max&auto=format&n=VsjUqn6fLqEhBiuI&q=85&s=d5651a45e4bfbabc33f74e146af3f94a)