{"uid":"cap_4eLS70Z2P38ZceB5R56h2","slug":"crypto-microdata-for-agents-swap-quote-x402-0a9dda50","name":"Crypto Microdata for Agents – Swap Quote (x402)","description":"Pay-per-call crypto microdata for trading/onchain AI agents via x402 (USDC on Base): Base gas, token risk, balances, multi-venue prices, Hyperliquid book/funding, kimchi premium. No API keys.","url":"https://kr-x402-mvp.kgy5612.workers.dev/v1/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":["from","to","amount"],"properties":{"to":{"type":"string","examples":["WETH"],"description":"Token out: symbol or 0x address"},"from":{"type":"string","examples":["USDC"],"description":"Token in: symbol (USDC, ETH, WETH, cbBTC, DAI, USDbC, AERO, DEGEN, BRETT, VIRTUAL) or 0x address"},"amount":{"type":"string","examples":["10"],"description":"Amount of token in, human units (e.g. 10 = 10 USDC)"},"wallet":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Optional sender/recipient: returns ready-to-sign tx + allowance/balance check"},"slippage_bps":{"type":"integer","maximum":2000,"minimum":1,"description":"Slippage tolerance in bps (default 50 = 0.5%)"}},"additionalProperties":false}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":{"type":"json","example":{"to":{"symbol":"WETH","address":"0x4200000000000000000000000000000000000006","decimals":18},"from":{"symbol":"USDC","address":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","decimals":6},"hops":1,"chain":"base","price":2224.6,"route":["pmm-2"],"router":"0x6131b5fae19ea4f9d964eac0408e4408b66337b5","source":"kyberswap","gas_usd":0.0319,"min_out":0.00447272,"verdict":"GOOD","cost_pct":-0.73,"guidance":"Good fill. Pass wallet= for ready-to-sign calldata; verify it with /crypto/decode-calldata before signing.","amount_in":10,"amount_out":0.0044952,"l1_fee_usd":0.0015,"net_out_usd":10.0153,"router_label":"KyberSwap MetaAggregation Router v2","slippage_bps":50,"amount_in_usd":9.976,"amount_out_usd":10.0487}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.003","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.003/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_GYpHBhl43L3EUmxEhRjdk","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.003","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns a multi-venue aggregated swap quote on Base (price, route, gas, min-out, verdict) for a token pair, optionally with ready-to-sign calldata.","exampleAgentPrompt":"Get me a swap quote for 10 USDC to WETH on Base using the aggregated DEX router — include the best price, gas cost, and fill verdict.","exampleUseCases":[{"title":"Pre-trade slippage sanity check","prompt":"Before I execute, get me a quote for swapping 500 USDC to cbBTC on Base and tell me if the fill looks good or bad, including gas costs and the net USD I'd receive."},{"title":"Wallet-ready swap calldata","prompt":"I want to swap 100 USDC to WETH on Base from my wallet 0xAbCd1234abcd1234abcd1234abcd1234abcd1234 — give me the ready-to-sign transaction calldata with 0.5% slippage."},{"title":"Best-price route comparison","prompt":"What's the best route and price right now to swap 1000 USDC to VIRTUAL on Base? Show me which venue wins and how many hops it takes."}],"resultDescription":"A JSON object containing: token-in and token-out metadata (symbol, address, decimals), number of route hops, chain, effective price, route venues, router address, source aggregator, gas cost in USD, L1 fee in USD, minimum output amount, net output in USD, a GOOD/OK/BAD verdict on fill quality, human-readable guidance, amount-in and amount-out in both native and USD units, and optionally ready-to-sign calldata when a wallet address is supplied.","failureModes":["Unsupported token symbol returns an error or empty route","No liquidity path found between the requested pair","Amount too small to cover gas may return negative net_out_usd","Missing required query params (from, to, amount) returns 400","x402 payment failure if USDC balance on Base is insufficient","Stale or unavailable aggregator data may yield suboptimal routes"],"whenToPreferThis":"Choose this endpoint when your agent needs a real-time, gas-adjusted, multi-venue swap quote on Base with a quality verdict — especially when you want calldata ready to sign without building your own aggregation layer. It is better than raw on-chain calls when you need cross-venue price comparison, gas estimation, and fill-quality guidance in a single pay-per-call request with no API key setup.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-31T18:41:46.383Z","isFirstParty":false,"canonicalSlug":"crypto-microdata-for-agents-swap-quote-x402-0a9dda50"}