Swap quote, best DEX route
Best price to swap one token for another on 30+ chains (Base, Ethereum, Arbitrum, Solana, BSC…) across DEX aggregators, via LI.FI: amount out, minimum after slippage, USD values, gas and fees, total cost in percent, route and approval address; with fromAddress, the unsigned transaction for your wallet to sign. Tokens by symbol or address, amounts in token units. A quote only: nothing is signed or sent. Use before a trading agent swaps.
Inputs
| Name | Type | Description |
|---|---|---|
fromChain (required) | string | Chain name or id: base, ethereum, arbitrum, solana… |
fromToken (required) | string | Token to sell: symbol (USDC, ETH) or address |
amount (required) | string | Amount of fromToken in token units, e.g. 100 or 0.5 |
fromAddress | string | Optional wallet that would send: adds the unsigned transaction to the answer |
toAddress | string | Optional receiving wallet, e.g. a Solana address when bridging to Solana |
slippage | number | Slippage tolerance in percent (default 0.5) |
toToken (required) | string | Token to buy: symbol or address |
Request
Over HTTP, with a card key from /credits:
curl -H "Authorization: Bearer adt_…" "https://agent-data-tools.revmesh2074.workers.dev/swap/quote?fromChain=base&fromToken=USDC&amount=1000&toToken=ETH"
Or one of your 25 free calls, no key:
curl "https://agent-data-tools.revmesh2074.workers.dev/swap/quote?fromChain=base&fromToken=USDC&amount=1000&toToken=ETH&trial=1"
Without a key, the same URL answers 402 Payment Required with x402 and MPP terms, so an agent with a wallet pays per call in USDC (Base, Polygon, Arbitrum or Solana over x402; Base or Tempo over MPP) and retries.
Example result
{
"route": "Fly",
"steps": [
{
"type": "swap",
"via": "Fly",
"fromChainId": 8453,
"toChainId": 8453
}
],
"from": {
"chainId": 8453,
"token": "USDC",
"address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"amount": "1000",
"amountUsd": 999.9
},
"to": {
"chainId": 8453,
"token": "ETH",
"address": "0x0000000000000000000000000000000000000000",
"amount": "0.448115540014",
"amountMin": "0.445874290140619979",
"amountUsd": 1000.92
},
"rate": 0.000448115540014,
"costs": {
"gasUsd": 0.02,
"feesUsd": 2.5,
"totalLossPercent": 0.25
},
"slippagePercent": 0.5,
"estimatedSeconds": 0,
"approvalAddress": "0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE",
"note": "A quote, not an order…",
"source": "LI.FI (li.quest)"
}
From an AI agent (MCP)
Add the MCP server to Claude, Cursor or any MCP client. This tool is swap_quote, and the first 25 successful calls are free:
https://agent-data-tools.revmesh2074.workers.dev/mcp