POST /v2/route
Auth X-Hub-Key from API_HUB_KEYExecute
POST /run/squid/v2/routeCache executed live on every call — a read-only POST answer is never cachedCost free · weight 0 · standard rate classSource billing freeRead-only route quote/plan for a same-chain swap or a cross-chain bridge: expected and minimum output, exchange rate, USD values, fee and gas breakdown, ETA and per-stop provider metadata.
The client forces quoteOnly=true; the returned transactionRequest is empty, so nothing signable or broadcastable is produced. Latency 0.31-0.79 s measured 2026-09-12.
Parameters
| name | in | type | description | |
|---|---|---|---|---|
fromChain | body | str | required | Source chain id or chain name the widget accepts (e.g. 8453, 42161) example: 8453 |
fromToken | body | str | required | Source token contract address on the source chain example: 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913 |
fromAmount | body | str | required | Source amount in the token's smallest unit (4 USDC = 4000000) example: 4000000 |
toChain | body | str | required | Destination chain id or chain name example: 42161 |
toToken | body | str | required | Destination token contract address on the destination chain example: 0xaf88d065e77c8cc2239327c5edb3a432268e5831 |
fromAddress | body | str | required | Sender address. A zero address (0x0000…0000) works; the quote does not need a real sender example: 0x0000000000000000000000000000000000000000 |
toAddress | body | str | optional | Recipient address; empty string when no recipient is chosen example: |
Response
type: object
pagination: none
sample: {
"route": "object"
}
Safe request
Reads the credential from API_HUB_KEY; it never appears in the URL.
curl -sX POST "https://openapihub.dev/run/squid/v2/route" \
-H "X-Hub-Key: $API_HUB_KEY" -H "Content-Type: application/json" \
-d '{"fromChain": "8453", "fromToken": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", "fromAmount": "4000000", "toChain": "42161", "toToken": "0xaf88d065e77c8cc2239327c5edb3a432268e5831", "fromAddress": "0x0000000000000000000000000000000000000000", "toAddress": ""}'