Price a swap and receive a routePlan you can hand back to /submit. Read-only, no user address required.
UseDocumentation Index
Fetch the complete documentation index at: https://docs.o1.exchange/llms.txt
Use this file to discover all available pages before exploring further.
POST /quote to fetch a price. The response includes a stable quoteId you echo on /submit when the user is ready to swap.
x-api-key header required.| Field | Type | Required | Description |
|---|---|---|---|
chainId | integer | yes | EVM chain ID. Currently only 8453 (Base) is supported. |
tokenIn | address | yes | Token to sell. Use 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE or the zero address for native ETH. |
tokenOut | address | yes | Token to buy. Same native sentinel rules apply. |
amountIn | string | yes | Amount in base units (wei) as a decimal string. Must be > 0. |
slippageBps | integer | yes | Slippage tolerance in basis points (100 = 1%). Range 0..10000. |
feeBps | integer | no | Integrator fee in basis points, taken out of expectedAmountOut. Range 0..10000. |
maxHops | integer | no | Maximum hops per route. Default 3. |
splitEnabled | boolean | no | Allow the optimizer to split the trade across multiple routes when it improves output. Default true. |
enforcePoolDisjoint | boolean | no | When splitting, require routes to use disjoint pool sets. Off by default. |
allowedDexes | array of DexId | no | Restrict routing to a subset of venues. See Supported DEXes. |
taker | address | no | Optional taker hint. Doesn’t affect pricing for most callers. |
timeBudgetMs | integer | no | Per-request override of the optimizer wall-clock budget. Range 50..10000. |
| Field | Type | Description |
|---|---|---|
quoteId | string | Stable identifier for this quote. Hand to /submit. |
expiresAt | integer | Unix milliseconds at which the cached quote drops. |
routePlan | object | Full plan including pricing, gas estimate, and per-leg detail. See the RoutePlan reference for every field. |
routePlan.expectedAmountOut — the price you displayroutePlan.minAmountOut — the worst case after slippageroutePlan.routes[].legs[].dex — list of venues used (e.g. UNIV3 → AERODROME_CL)routePlan.feeBps — protocol + integrator fee in bpsroutePlan.gasEstimate.gasUnits — estimated gas for the swapquoteId 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.
EVM chain id. 8453 for Base (current Phase-1 target).
x >= 120-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.
^0x[a-fA-F0-9]{40}$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.
^0x[a-fA-F0-9]{40}$Non-negative integer encoded as a decimal string (wei).
^[0-9]+$0 <= x <= 10000x >= 11UNIV2, 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 Integrator fee in bps, charged out of the output amount.
0 <= x <= 1000020-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.
^0x[a-fA-F0-9]{40}$Per-request override of the optimizer's wall-clock budget. Omit to inherit the engine default.
50 <= x <= 10000