{"uid":"cap_PZtxDRLYn-o5eebMVI1BT","slug":"3route-multichain-swap-quote-transaction-builder-c9fcff5d","name":"3Route Multichain 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://3route.agents.bakingbad.dev/v1/%7BchainId%7D/swap","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":["4663","42793","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."},"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"},"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_dGiNXem5TLYuefd_JQUUH","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 an optimized unsigned swap transaction (route, amounts, gas) for exchanging one token for another on a specified EVM-compatible chain.","exampleAgentPrompt":"I want to swap 1 ETH (0x0000000000000000000000000000000000000000) for the token at 0x5fc5360d0400a0fd4f2af552add042d716f1d168 on Etherlink (chain 4663), sending from my address 0x1111111111111111111111111111111111111111 — give me the best route and build me the unsigned transaction.","exampleUseCases":[{"title":"Native asset to ERC-20 token swap","prompt":"I need to swap 0.5 ETH for the token at 0x5fc5360d0400a0fd4f2af552add042d716f1d168 on chain 4663 from my wallet 0x1111111111111111111111111111111111111111 — find me the best route and return the unsigned transaction so I can sign and submit it."},{"title":"Agent-automated DeFi rebalancing","prompt":"Rebalance my portfolio by swapping 1000000 units of token 0xabc1230000000000000000000000000000000001 for token 0xdef4560000000000000000000000000000000002 on chain 42793, from address 0x2222222222222222222222222222222222222222, with 0.5% slippage tolerance — give me the unsigned swap transaction."},{"title":"Cross-token quote before execution","prompt":"Before I pull the trigger, get me a 3Route quote for selling 2000000000000000000 units of 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1 to buy 0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb on Ghostnet chain 128064 from 0x3333333333333333333333333333333333333333 — how much will I receive and what does the transaction look like?"}],"resultDescription":"A JSON object containing: an unsigned transaction (to, from, data, value, gas, gasPrice) ready for wallet signing; the expected destination token amount (dstAmount); the minimum guaranteed destination amount after slippage (dstAmountMin); the source amount; and the estimated gas cost.","failureModes":["Invalid or unsupported chainId returns an error — only 4663, 42793, and 128064 are supported","Malformed token address (not 0x + 40 hex chars) returns a 400 validation error","Insufficient liquidity for the requested pair returns an error or zero amount","Amount of zero or non-integer string causes a validation failure","Payment not included or insufficient (x402) returns a 402 Payment Required response","Slippage set too low may cause no valid route to be found"],"whenToPreferThis":"Use this endpoint when you need an optimized, agent-ready unsigned swap transaction on Etherlink or supported EVM chains (4663, 42793, 128064), particularly when integrating into autonomous agent workflows that require multichain DeFi routing without a frontend. Prefer this over generic DEX aggregators when operating on Tezos-adjacent EVM chains where 3Route's Baking Bad expertise provides better routing coverage.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T12:45:12.217Z","isFirstParty":false}