Build a broadcast-ready transaction from a previously fetched quoteId.
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 /submit to convert a quoteId from POST /quote into the calldata your wallet broadcasts.
x-api-key header required./quote. Submitting an expired quoteId returns 404.| Field | Type | Required | Description |
|---|---|---|---|
quoteId | string | yes | The quoteId from a recent /quote response. |
user | address | yes | The wallet that will sign and broadcast the transaction. |
useNativeIn | boolean | no | Override routePlan.nativeIn. Set true to send native ETH; the router wraps msg.value to WETH before dispatching legs. |
unwrapNativeOut | boolean | no | Override routePlan.nativeOut. Set true to receive native ETH instead of WETH. |
permit | object | no | Optional EIP-2612 permit payload for one-tx approve+swap. See permit payload below. |
gasPriceWei | string | no | Hint for legacy gas pricing (gasPrice). |
maxFeePerGasWei | string | no | Hint for EIP-1559 maxFeePerGas. |
maxPriorityFeePerGasWei | string | no | Hint for EIP-1559 maxPriorityFeePerGas. |
permit payloadtokenIn, include it to skip the standard approve transaction.
| Field | Type | Notes |
|---|---|---|
value | string | Amount permitted in token base units. Must be >= amountIn. |
deadline | integer | Unix seconds at which the permit expires. |
v / r / s | components | EIP-2612 signature pieces. |
| Field | Type | Description |
|---|---|---|
quoteId | string | Echo of the quoteId you submitted. |
chainId | integer | Always 8453 while only Base is supported. |
to | address | Always the O1Router address. See Router contract. |
data | hex | Encoded swapExactIn(...) calldata. |
value | string | msg.value to send with the transaction in wei. Non-zero only for native-in swaps (useNativeIn: true). |
viem:
| Want to | Set on /quote | Set on /submit |
|---|---|---|
| Sell native ETH | tokenIn = native sentinel (0xEeee...EEeE or 0x0) | useNativeIn: true |
| Receive native ETH | tokenOut = native sentinel | unwrapNativeOut: true |
value carries amountIn and the router wraps to WETH internally. See the Native ETH guide for the full matrix.
/quote with the same parameters and resubmit. Don’t cache quoteId longer than expiresAt minus a small safety window.useNativeIn: true. The router can’t infer it from tokenIn alone in /submit because the API does not assume the user has changed their mind since /quote./quote and broadcast. Increase slippageBps slightly or re-quote and resend.tokenIn. Approve O1Router for at least amountIn, or use a permit payload. See ERC-20 approvals.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}$Override routePlan.nativeIn. When true the router wraps
msg.value to WETH before dispatching legs.
Override routePlan.nativeOut. When true the router unwraps WETH to ETH for the recipient.
Non-negative integer encoded as a decimal string (wei).
^[0-9]+$Non-negative integer encoded as a decimal string (wei).
^[0-9]+$Non-negative integer encoded as a decimal string (wei).
^[0-9]+$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]*$msg.value in wei (non-zero only for native-in swaps).
^[0-9]+$