DeFi Relay Quoter - Pay-per-use 0x Swap API This service provides access to 0x swap API using the x402 payment protocol. PRICING: Price endpoints (indicative): 500 raw USDC per request Quote endpoints (full quote): 1000 raw USDC per request ENDPOINTS: Permit2 (requires Permit2 approval): GET /swap/permit2/price - Get indicative price GET /swap/permit2/quote - Get full quote with transaction data AllowanceHolder (single signature, recommended): GET /swap/allowance-holder/price - Get indicative price GET /swap/allowance-holder/quote - Get full quote with transaction data REQUIRED QUERY PARAMETERS: chainId - Chain ID (e.g., 1 for Ethereum, 8453 for Base) sellToken - Address of token to sell (use 0xeee...eee for native ETH) buyToken - Address of token to buy sellAmount - Amount to sell in smallest unit (wei) - OR use buyAmount taker - Address that will execute the swap OPTIONAL PARAMETERS: buyAmount - Amount to buy (alternative to sellAmount) slippageBps - Slippage tolerance in basis points (e.g., 100 = 1%) excludedSources - Liquidity sources to exclude includedSources - Liquidity sources to include EXAMPLE REQUEST: GET /swap/permit2/quote?chainId=1&sellToken=0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee&buyToken=0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48&sellAmount=1000000000000000000&taker=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 Header: X-PAYMENT: OTHER ENDPOINTS: GET / - This help page GET /health - Health check GET /agent.json - EIP-8004 agent metadata GET /.well-known/x402 - x402 discovery document PERMIT2 vs ALLOWANCE-HOLDER: - AllowanceHolder: Single signature, better UX, lower gas. Recommended for most use cases. - Permit2: Universal standard, shared approvals across apps, requires two signatures. SUPPORTED CHAINS: - Ethereum (1) - Base (8453) - Arbitrum (42161) - Optimism (10) - Polygon (137) - Avalanche (43114) - BSC (56) For more info on x402: https://www.x402.org For 0x API docs: https://0x.org/docs/api