{"uid":"cap_t1fqUlhIq2bITz_tlQO4K","slug":"3route-swap-quote-transaction-builder-d1ba4044","name":"3Route Swap Quote & Transaction Builder","description":"Best-priced crypto token swaps for agents, traders and apps. Pay-per-call quote & swap API via x402/MPP. No API key or subscription.","url":"https://api.3route.io/v1/%7BchainId%7D/swap?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"},"pathParams":{"type":"object","required":["chainId"],"properties":{"chainId":{"enum":["1","4663","42793","8453","143","128064"],"type":"string","example":"4663","pattern":"^[0-9]+$","description":"Chain ID for the operation."}},"additionalProperties":false},"queryParams":{"type":"object","required":["src","dst","amount","from"],"properties":{"dst":{"type":"string","example":"0x5fc5360d0400a0fd4f2af552add042d716f1d168","pattern":"^0x[0-9a-fA-F]{40}$","description":"Address of the token being bought; take one from the token-list operation for the selected chain, or use the zero address, or the case-insensitive sentinel 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee, for the chain's native asset."},"fee":{"type":"number","default":0,"maximum":3,"minimum":0},"src":{"type":"string","example":"0x0000000000000000000000000000000000000000","pattern":"^0x[0-9a-fA-F]{40}$","description":"Address of the token being sold; use the zero address, or the case-insensitive sentinel 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee, for the chain's native asset."},"from":{"type":"string","example":"0x1111111111111111111111111111111111111111","pattern":"^0x[0-9a-fA-F]{40}$","description":"Address that signs and sends the transaction, and that the src tokens are taken from"},"amount":{"type":"string","example":"1000000000000000000","pattern":"^[0-9]+$","description":"Positive amount of src to sell in smallest units, as an integer string."},"permit":{"type":"string","pattern":"^0x[0-9a-fA-F]*$"},"gasPrice":{"type":"string","example":"1000000000","pattern":"^[0-9]+$"},"receiver":{"type":"string","example":"0x1111111111111111111111111111111111111111","pattern":"^0x[0-9a-fA-F]{40}$"},"referrer":{"type":"string","example":"0x1111111111111111111111111111111111111111","pattern":"^0x[0-9a-fA-F]{40}$"},"slippage":{"type":"number","default":1,"example":1,"maximum":50,"minimum":0},"protocols":{"type":"string"},"usePermit2":{"type":"boolean","default":false},"includeProtocols":{"type":"boolean","default":false},"excludedProtocols":{"type":"string"},"includeTokensInfo":{"type":"boolean","default":false},"includeBlockNumber":{"type":"boolean","default":false}},"additionalProperties":false}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":{"type":"json","example":{"tx":{"to":"0x2222222222222222222222222222222222222222","gas":"210000","data":"0x1234","from":"0x1111111111111111111111111111111111111111","value":"1000000000000000000","gasPrice":"1000000000"},"gas":210000,"dstAmount":"950000","srcAmount":"1000000000000000000","dstAmountMin":"940500"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","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.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_f-K3U2Wp2GOLGDEoUDBbO","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns a best-priced swap quote and ready-to-sign transaction for exchanging one crypto token for another on a specified EVM chain.","exampleAgentPrompt":"Get me the best swap quote and transaction to sell 1 ETH (1000000000000000000 wei) for USDC on chain 4663, from my wallet 0x1111111111111111111111111111111111111111, with 1% slippage — I want the ready-to-sign transaction data.","exampleUseCases":[{"title":"DeFi agent auto-rebalancing portfolio","prompt":"I want to rebalance my portfolio on chain 4663 — sell 500000000000000000 wei of the native asset from wallet 0xAbCd...1234 and buy USDC at 0x5fc5360d0400a0fd4f2af552add042d716f1d168, use 0.5% slippage and give me the transaction I need to sign."},{"title":"Best-price token swap for trading bot","prompt":"Get me the cheapest route to swap 2000000 USDC (address 0x5fc5360d0400a0fd4f2af552add042d716f1d168) for the native token on chain 42793 from wallet 0x2222222222222222222222222222222222222222 with 1% slippage — show me the expected output and the transaction data."},{"title":"Cross-token payment settlement","prompt":"Build a swap transaction on chain 128064 to sell exactly 1000000000000000000 wei of token 0xAaaa...0001 from address 0x3333333333333333333333333333333333333333 and receive token 0xBbbb...0002 at wallet 0x4444444444444444444444444444444444444444, with 2% slippage allowed."}],"resultDescription":"Returns a JSON object containing: a ready-to-sign transaction object (to, from, data, value, gas, gasPrice), the expected destination token amount (dstAmount), minimum guaranteed destination amount accounting for slippage (dstAmountMin), the source amount (srcAmount), and a gas estimate integer.","failureModes":["Unsupported chainId enum value returns an error — only 4663, 42793, and 128064 are valid","Invalid token address format (not 0x + 40 hex chars) causes a schema validation error","Insufficient liquidity for the requested token pair or amount returns no route found","Amount of zero or non-integer amount string causes a bad request error","Slippage out of bounds (>50 or <0) causes parameter validation failure","Payment not fulfilled via x402/MPP results in 402 Payment Required before any quote is returned"],"whenToPreferThis":"Choose this endpoint when you need a pay-per-call, no-subscription DEX aggregator quote and executable swap transaction on one of the three supported EVM chains (4663, 42793, 128064). It is ideal for AI agents and bots that need on-demand pricing without managing API keys, and for apps requiring ready-to-sign transaction calldata rather than just a price estimate.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-18T18:09:34.406Z","isFirstParty":false,"canonicalSlug":"3route-swap-quote-transaction-builder-d1ba4044"}