Skip to main content
POST
Build a broadcast-ready transaction for a previously issued quote
Use POST /submit to convert a quoteId from POST /quote into the calldata your wallet broadcasts.
  • Authentication: x-api-key header required.
  • Quote TTL: quotes expire roughly 10 seconds after /quote. Submitting an expired quoteId returns 404.

Request

Body parameters

The gas price fields are hints only. They are not currently echoed back into the calldata; your wallet client should set its own gas pricing when broadcasting.

permit payload

When you have a fresh EIP-2612 permit signature for tokenIn, include it to skip the standard approve transaction.
The router consumes the permit inside the same transaction; if it fails, the whole swap reverts. See ERC-20 approvals for the full pattern.

Response

Response fields

Sending the transaction

The response is intentionally minimal so any signer works. Example with viem:
ethers v6:
Do not modify data before sending. The router validates the route plan against the submitted quoteId; any tamper attempt will revert.

Native ETH and unwrap behavior

When you sell native ETH, the response value carries amountIn and the router wraps to WETH internally. See the Native ETH guide for the full matrix.

Common pitfalls

404 on /submit

Quote expired. Re-fetch via /quote with the same parameters and resubmit. Don’t cache quoteId longer than expiresAt minus a small safety window.

`value` is 0 for ETH swaps

You forgot 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.

Tx reverts with slippage error

Pool state moved between /quote and broadcast. Increase slippageBps slightly or re-quote and resend.

Allowance error

The user hasn’t approved the router for tokenIn. Approve O1Router for at least amountIn, or use a permit payload. See ERC-20 approvals.

Authorizations

x-api-key
string
header
required

Body

application/json
quoteId
string
required
user
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}$
useNativeIn
boolean

Override routePlan.nativeIn. When true the router wraps msg.value to WETH before dispatching legs.

unwrapNativeOut
boolean

Override routePlan.nativeOut. When true the router unwraps WETH to ETH for the recipient.

permit
object
gasPriceWei
string

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

Pattern: ^[0-9]+$
maxFeePerGasWei
string

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

Pattern: ^[0-9]+$
maxPriorityFeePerGasWei
string

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

Pattern: ^[0-9]+$

Response

Transaction payload

quoteId
string
required
chainId
integer
required
to
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}$
data
string
required

Hex-encoded bytes.

Pattern: ^0x[a-fA-F0-9]*$
value
string
required

msg.value in wei (non-zero only for native-in swaps).

Pattern: ^[0-9]+$