Orkid

POST /api/v1/route

Get an executable quote for a swap.

Get a quote for a same-chain swap. This endpoint returns the expected output amount, routing details, and gasless eligibility — but does not execute anything.

Request

POST https://orkidlabs.xyz/api/v1/route
Content-Type: application/json
X-ORKID-API-Key: <key>

{
  "from": "USDC",
  "to": "WETH",
  "amount": "25.0",
  "chain": "base",
  "fromAddress": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
  "fromDecimals": 6,
  "toAddress": "0x4200000000000000000000000000000000000006",
  "toDecimals": 18
}

Parameters

FieldTypeRequiredDescription
fromstringYesInput token symbol (e.g. USDC) or address
tostringYesOutput token symbol (e.g. WETH) or address
amountstringYesInput amount in human-readable units (e.g. "25.0")
chainstringYesbase, ethereum, arbitrum, or polygon
fromAddressstringRecommendedInput token contract address
fromDecimalsnumberRecommendedInput token decimals
toAddressstringRecommendedOutput token contract address
toDecimalsnumberRecommendedOutput token decimals

Explicit *_address + *_decimals is recommended because symbol resolution is server-side and may not cover every token.

Response

{
  "ok": true,
  "quote": {
    "amountIn": "25.000000",
    "amountOut": "0.010184",
    "amountOutRaw": "10183963710975259",
    "volumeUsd": 25,
    "rate": "0.000407 WETH/USDC",
    "protocol": "aerodrome_slipstreams",
    "poolAddress": "0xc758d81b9b81a6fcdad075bd471874a2c46b54e0",
    "priceImpactBps": 9.66
  },
  "gaslessEligible": true,
  "computeMs": 142
}

Fields

FieldTypeDescription
okbooleantrue on success
quote.amountInstringInput amount
quote.amountOutstringExpected output amount (human-readable)
quote.amountOutRawstringExpected output amount (raw integer)
quote.volumeUsdnumberUSD value of the swap
quote.ratestringExchange rate
quote.protocolstringDEX protocol used for routing
quote.poolAddressstringPrimary pool address
quote.priceImpactBpsnumberPrice impact in basis points
gaslessEligiblebooleanWhether the solver can subsidize gas
computeMsnumberServer-side compute time

Error response

{
  "ok": false,
  "error": "Swap too small for gasless execution: $5.00 below $20 minimum on base.",
  "gaslessEligible": false,
  "computeMs": 45
}

Common errors:

ErrorCause
Swap too small...Below gasless minimum for the chain
Price impact too high: X bps...Slippage exceeds 500 bps max — try a smaller amount
Invalid or revoked API keyBad/missing key or rate limit hit

See Error & retry guide for the full list.

On this page