{"uid":"cap_RB0dwmejg1R5oqSoEnv5w","slug":"3route-swap-api-abd42178","name":"3Route Swap API","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/pro/%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"],"type":"string","example":"4663","pattern":"^[0-9]+$","description":"Chain ID for the operation."}},"additionalProperties":false},"queryParams":{"type":"object","required":["src","dst","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":"Single amount in smallest units. Cannot be combined with amounts; one of the two is required."},"permit":{"type":"string","pattern":"^0x[0-9a-fA-F]*$"},"amounts":{"type":"string","pattern":"^[0-9]+(,[0-9]+)*$","description":"Comma-separated amounts in smallest units. Cannot be combined with amount; one of the two is required."},"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"},"timestamp":{"type":"integer","minimum":0},"usePermit2":{"type":"boolean","default":false},"blockNumber":{"type":"integer","minimum":0},"isExactOutput":{"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_OEiJjSTiqwCqvOe33_9hs","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-submit transaction for exchanging one crypto token for another on a specified chain","exampleAgentPrompt":"Swap 1 ETH (0x0000000000000000000000000000000000000000) for USDC (0x5fc5360d0400a0fd4f2af552add042d716f1d168) on chain 4663, from my wallet 0x1111111111111111111111111111111111111111, with 1% slippage — give me the best-priced transaction calldata I can submit.","exampleUseCases":[{"title":"DeFi agent auto-rebalancing portfolio","prompt":"I need to swap 500 USDC for WETH on chain 4663 from wallet 0xAbCd...1234, get me the cheapest route with 0.5% slippage so I can rebalance my portfolio."},{"title":"Onchain payment in preferred token","prompt":"Convert exactly 1000000000000000000 units of the native asset into token 0x5fc5360d0400a0fd4f2af552add042d716f1d168 on chain 4663, sending from 0x2222222222222222222222222222222222222222 — what transaction should I sign?"},{"title":"Pre-trade price check before executing","prompt":"How much of token 0x5fc5360d0400a0fd4f2af552add042d716f1d168 will I get if I sell 2000000000000000000 units of 0x0000000000000000000000000000000000000000 on chain 4663 from my wallet 0x3333333333333333333333333333333333333333? Use 1% slippage."}],"resultDescription":"Returns a JSON object containing: a ready-to-submit transaction object (to, from, data, value, gas, gasPrice), the expected destination token amount, the minimum acceptable destination amount after slippage, and the source amount confirmed. The agent can directly broadcast the tx object to the chain.","failureModes":["Invalid or unsupported chainId returns an error — only chain 4663 is currently supported","Malformed token address (non-hex, wrong length) returns a 400 validation error","Insufficient liquidity for the requested pair or amount returns an error or zero dstAmount","Amount of zero or non-integer string causes a validation failure","Payment not made via x402/MPP results in a 402 Payment Required response","Slippage set too low may cause swap to revert on-chain even if quote succeeds"],"whenToPreferThis":"Choose this endpoint when you need a best-priced, aggregated swap quote AND executable transaction calldata in a single call, without requiring an API key or subscription — especially in agentic or pay-per-use workflows using x402/MPP micropayments. Prefer it over static DEX contracts when you want routing optimization across multiple liquidity sources on the supported chain.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-20T18:30:05.382Z","isFirstParty":false,"canonicalSlug":"3route-swap-api-abd42178"}