---
title: "Price a swap and return a routePlan"
method: POST
path: "/quote"
tags: ["quote"]
---

# Price a swap and return a routePlan

`POST /quote`

## Request body

- QuoteRequest
  - `chainId` integer, required — EVM chain id. 8453 for Base (current Phase-1 target).
  - `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`.
  - `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`.
  - `amountIn` string, required — Non-negative integer encoded as a decimal string (wei).
  - `slippageBps` integer, required
  - `maxHops` integer
  - `splitEnabled` boolean
  - `enforcePoolDisjoint` boolean
  - `allowedDexes` DexId[]
  - `feeBps` integer — Integrator fee in bps, charged out of the output amount.
  - `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`.
  - `timeBudgetMs` integer — Per-request override of the optimizer's wall-clock budget. Omit to inherit the engine default.

## Response `200`

Quote produced

- QuoteResponse
  - `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` RoutePlan, required
    - `chainId` integer, required
    - `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`.
    - `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`.
    - `amountIn` string, required — Non-negative integer encoded as a decimal string (wei).
    - `expectedAmountOut` string, required — Non-negative integer encoded as a decimal string (wei).
    - `minAmountOut` string, required — Non-negative integer encoded as a decimal string (wei).
    - `feeBps` integer
    - `slippageBps` integer, required
    - `routes` SplitRoute[], required
      - `amountIn` string, required — Non-negative integer encoded as a decimal string (wei).
      - `legs` RouteLeg[], required
        - `dex` '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', required
        - `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`.
        - `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`.
        - `amountIn` string, required — Non-negative integer encoded as a decimal string (wei).
        - `minOut` string, required — Non-negative integer encoded as a decimal string (wei).
        - `poolId` string
        - `data` union, required — Tagged union discriminated by `kind`. Direct-pool legs (`v2_direct`, `v3_direct`, `pancake_v3_direct`, `algebra_direct`) carry a single pool address and are dispatched by the corresponding O1Router adapter. Multi-hop venue legs (`univ4`, `aerodrome_v2`, `curve`, `dodo_v2`, `woofi`, `prop_amm`) carry venue-specific routing data. Legacy `univ2` / `univ3` shapes are still emitted for older quotes in transit.
          - V2DirectLegData
            - `kind` 'v2_direct', required
            - `pool` 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`.
            - `feeBps` integer, required
          - V3DirectLegData
            - `kind` 'v3_direct', required
            - `pool` 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`.
          - PancakeV3DirectLegData
            - `kind` 'pancake_v3_direct', required
            - `pool` 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`.
          - AlgebraDirectLegData
            - `kind` 'algebra_direct', required
            - `pool` 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`.
          - HydrexLegData
            - `kind` 'hydrex', required
            - `deadline` integer
          - UniV4LegData
            - `kind` 'univ4', required
            - `commands` string, required — Hex-encoded bytes.
            - `inputs` Hex[], required
            - `deadline` integer
          - CurveLegData
            - `kind` 'curve', required
            - `pool` 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`.
            - `i` integer, required
            - `j` integer, required
          - PropAmmLegData
            - `kind` 'prop_amm', required
            - `router` 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`.
            - `protocol` 'propswap' | 'tessera' | 'elfomofi' | 'lunarbase' | 'feltir', required
          - DodoV2LegData
            - `kind` 'dodo_v2', required
            - `pool` 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`.
            - `baseToken` 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`.
          - WooFiLegData
            - `kind` 'woofi', required
            - `router` 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`.
          - UniV2LegData
            - `kind` 'univ2', required
            - `path` Address[], required
            - `deadline` integer
          - UniV3LegData
            - `kind` 'univ3', required
            - `path` string, required — Hex-encoded bytes.
            - `deadline` integer
          - AerodromeLegData
            - `kind` 'aerodrome_v2', required
            - `routes` AerodromeRoute[], required
              - …
            - `deadline` integer
    - `blockNumber` integer, required
    - `gasEstimate` GasEstimate
      - `gasUnits` integer, required
      - `gasCostWei` string — Non-negative integer encoded as a decimal string (wei).
    - `feeBreakdown` FeeBreakdown
      - `protocolFeeAmount` string, required — Non-negative integer encoded as a decimal string (wei).
      - `integratorFeeAmount` string, required — Non-negative integer encoded as a decimal string (wei).
    - `metadata` RouteMetadata
      - `connectorsConsidered` Address[], required
      - `candidatePaths` integer, required
      - `selectedPaths` integer, required
      - `candidates` RouteCandidateMetadata[], required
        - `path` Address[], required
        - `dexes` DexId[], required
        - `projectedOut` string, required — Non-negative integer encoded as a decimal string (wei).
        - `allocatedIn` string, required — Non-negative integer encoded as a decimal string (wei).
        - `score` number, required
    - `nativeIn` boolean — Set when the original request used the ETH sentinel for tokenIn. The submit handler must send `msg.value = amountIn` and set `useNativeIn: true` so the router wraps to WETH before dispatching legs.
    - `nativeOut` boolean — Mirror of nativeIn for tokenOut = ETH (unwrap WETH).
  - `expiresAt` integer, required — Unix epoch milliseconds at which the cached quote drops.

## Other responses

- `400` — Validation error
- `401` — Missing or incorrect x-api-key
- `429` — Sliding-window rate limit exceeded (default 120/min/IP)

---

[API](https://skmtc.net/o1/apis/o1-dex-aggregator-api.md) · [All operations](https://skmtc.net/o1/apis/o1-dex-aggregator-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/o1/o1-dex-aggregator-api/versions/1f515e2b6102/schema)
