Skip to main content
POST
Price a swap and return a routePlan
Use POST /quote to fetch a price. The response includes a stable quoteId you echo on /submit when the user is ready to swap.
  • Authentication: x-api-key header required.
  • Rate limit: 120 req/min per key (default). See Rate limits.

Request

Body parameters

Response

Response fields

The fields you’ll most commonly surface to users:
  • routePlan.expectedAmountOut — the price you display
  • routePlan.minAmountOut — the worst case after slippage
  • routePlan.routes[].legs[].dex — list of venues used (e.g. UNIV3 → AERODROME_CL)
  • routePlan.feeBps — protocol + integrator fee in bps
  • routePlan.gasEstimate.gasUnits — estimated gas for the swap

Caching and freshness

Quotes are cached server-side under their quoteId for roughly 10 seconds. After expiresAt, calling /submit returns 404 quote not found or expired. For UIs that show a live price, the recommended pattern is to re-fetch the quote every 5 to 8 seconds while the swap modal is open. See Quote freshness.

Examples

Pair this with POST /submit for the standard two-step flow, or use POST /execute when you don’t need a price preview step.

Authorizations

x-api-key
string
header
required

Body

application/json
chainId
integer
required

EVM chain id. 8453 for Base (current Phase-1 target).

Required range: x >= 1
tokenIn
string
required

20-byte hex address. The sentinel 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE (or the zero address) signals the chain's native asset (ETH on Base) and is recognized in tokenIn/tokenOut.

Pattern: ^0x[a-fA-F0-9]{40}$
tokenOut
string
required

20-byte hex address. The sentinel 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE (or the zero address) signals the chain's native asset (ETH on Base) and is recognized in tokenIn/tokenOut.

Pattern: ^0x[a-fA-F0-9]{40}$
amountIn
string
required

Non-negative integer encoded as a decimal string (wei).

Pattern: ^[0-9]+$
slippageBps
integer
required
Required range: 0 <= x <= 10000
maxHops
integer
Required range: x >= 1
splitEnabled
boolean
enforcePoolDisjoint
boolean
allowedDexes
enum<string>[]
Minimum array length: 1
Available options:
UNIV2,
UNIV3,
UNIV4,
AERODROME_V2LIKE,
AERODROME_CL,
PANCAKE_V2,
PANCAKE_V3,
PANCAKE_INFINITY_CL,
HYDREX,
QUICKSWAP_V4,
ALIEN_BASE_V3,
CURVE,
PROPSWAP,
TESSERA,
ELFOMOFI,
LUNARBASE,
FELTIR,
DODO_V2,
WOOFI,
GYROSCOPE_ECLP,
MAVERICK_V2
feeBps
integer

Integrator fee in bps, charged out of the output amount.

Required range: 0 <= x <= 10000
taker
string

20-byte hex address. The sentinel 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE (or the zero address) signals the chain's native asset (ETH on Base) and is recognized in tokenIn/tokenOut.

Pattern: ^0x[a-fA-F0-9]{40}$
timeBudgetMs
integer

Per-request override of the optimizer's wall-clock budget. Omit to inherit the engine default.

Required range: 50 <= x <= 10000

Response

Quote produced

quoteId
string
required

SHA-256 (or HMAC-SHA256 if the server has O1_QUOTE_SIGNING_KEY set) of the quote payload. Echo this on /submit.

routePlan
object
required
expiresAt
integer<int64>
required

Unix epoch milliseconds at which the cached quote drops.