POST /execute
One-shot quote + submit. Returns a fresh quote and broadcast-ready calldata in a single call.
POST /execute is the one-step convenience endpoint. It runs /quote and /submit server-side and returns both the route plan (so you can display it) and the calldata (so you can broadcast).
Use this when:
- You don’t need a separate price preview step (one-click swap, server-side bot).
- You want to avoid the
quoteIdround trip. - You always submit immediately after quoting.
/quote + /submit two-step flow so the user sees the final price before signing.
- Authentication:
x-api-keyheader required. useris required here (unlike/quote) because the response includes signed-ready calldata.
Request
- Endpoint
- Body
Body parameters
/execute accepts the union of /quote and /submit parameters.
| Field | Type | Required | Description |
|---|---|---|---|
chainId | integer | yes | 8453 for Base. |
tokenIn | address | yes | Token to sell. Native sentinel allowed. |
tokenOut | address | yes | Token to buy. Native sentinel allowed. |
amountIn | string | yes | Amount in wei as a decimal string. |
slippageBps | integer | yes | Slippage tolerance in bps (0..10000). |
user | address | yes | Wallet that will sign the tx. |
useNativeIn | boolean | no | Override native-in detection. |
unwrapNativeOut | boolean | no | Receive native ETH instead of WETH. |
feeBps | integer | no | Integrator fee in bps. |
maxHops | integer | no | Default 3. |
splitEnabled | boolean | no | Default true. |
enforcePoolDisjoint | boolean | no | Default false. |
allowedDexes | array of DexId | no | Restrict routing to specific venues. |
permit | object | no | EIP-2612 permit payload (same shape as /submit). |
POST /quote and POST /submit for full descriptions of each field.
Response
- 200 OK
- 400 Bad Request
- 429 Rate Limited
Response fields
A union of the/quote response (so you can display the price) and /submit response (so you can broadcast).
| Field | Type | Description |
|---|---|---|
quoteId | string | The freshly issued quote ID. Useful for log correlation. |
chainId | integer | 8453. |
to | address | Always the O1Router. |
data | hex | swapExactIn(...) calldata. |
value | string | msg.value in wei. |
expiresAt | integer | Unix milliseconds at which the cached quote drops. |
routePlan | object | Full route plan. See RoutePlan reference. |
Examples
Authorizations
Body
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 <= 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}$x >= 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 0 <= x <= 10000Response
Quote + transaction payload
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}$Hex-encoded bytes.
^0x[a-fA-F0-9]*$Non-negative integer encoded as a decimal string (wei).
^[0-9]+$