{"uid":"cap_lksLpQa_-YqRkdVGdDYTN","slug":"token-swap-quote-on-base-x402-c9ed0d79","name":"Token Swap Quote on Base (x402)","description":"X402 micropayments server — AI agents pay USDC for OFAC screening, rates, and billing verification.","url":"https://x402helper.xyz/89e509/swap/quote?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["tokenIn","tokenOut","amountIn","recipient"],"properties":{"tokenIn":{"type":"string","default":null,"description":"Sell token: a supported symbol (WETH, USDC, AERO, ...) or a 0x ERC-20 address on Base."},"amountIn":{"type":"string","default":null,"description":"Sell amount in RAW atomic units of tokenIn (e.g. 1 WETH = 1000000000000000000). Integer as string."},"tokenOut":{"type":"string","default":null,"description":"Buy token: a supported symbol or a 0x ERC-20 address on Base."},"recipient":{"type":"string","default":null,"description":"0x address that receives tokenOut (baked into the calldata)."},"slippageBps":{"type":"integer","default":null,"description":"Max slippage in basis points (50 = 0.5%). Default 50, max 5000."},"deadlineSeconds":{"type":"integer","default":null,"description":"Seconds from now until the swap deadline. Default 600."}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":{"type":"json","example":{"result":{},"success":true}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.065","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.065/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.065","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.065","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_Mjy106-pp92O5OH5aXLap","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.065","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns a DEX swap quote for exchanging ERC-20 tokens on the Base network, including calldata for executing the swap on-chain.","exampleAgentPrompt":"Get me a swap quote to sell 1000000000000000000 raw units of WETH for USDC on Base, sending the output to 0xAbC123...456, with 50 basis points max slippage.","exampleUseCases":[{"title":"DeFi arbitrage price check","prompt":"What's the current swap quote to trade 500 USDC (500000000 raw units) for AERO on Base, sending to my wallet 0xDe12...aB34 with 100 bps slippage tolerance?"},{"title":"On-chain swap execution prep","prompt":"I need calldata to swap 1 WETH (1000000000000000000 raw units) into USDC on Base — recipient is 0xFe45...Cd67, use default 50 bps slippage and a 10-minute deadline."},{"title":"Token portfolio rebalancing quote","prompt":"Give me a quote to convert 2000000 raw USDC into WETH on Base for wallet 0xAa11...Bb22, I want to know the expected output before I execute."}],"resultDescription":"A JSON object with a 'success' boolean and a 'result' object containing the swap quote details — including expected output amount, exchange rate, calldata for executing the swap, and routing information for the Base network DEX aggregator.","failureModes":["Unsupported token symbol or invalid ERC-20 address returns an error result","amountIn of zero or non-integer string causes validation failure","Invalid or non-checksummed recipient address rejected","slippageBps exceeding 5000 (50%) rejected","Payment of 0.065 USDC via x402 fails if agent wallet lacks funds","Token pair with no liquidity returns no route found error","Network congestion may cause stale or unavailable quotes"],"whenToPreferThis":"Use this endpoint when you need a real-time DEX swap quote specifically on the Base network for ERC-20 tokens (including WETH, USDC, AERO, and arbitrary 0x addresses). It is ideal for AI agents that need to price or prepare on-chain swaps programmatically and are willing to pay a small USDC micropayment per call via the x402 protocol. Prefer this over centralized exchange price feeds when you need executable calldata, not just indicative prices.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-28T00:50:06.904Z","isFirstParty":false,"canonicalSlug":"token-swap-quote-on-base-x402-c9ed0d79"}