LLMs.txt: agent-readable Markdown index of this site at /llms.txt
POSTCreate swap EIP 7702 calldata

Create swap EIP 7702 calldata

Create the EIP 7702 calldata for a swap transaction (including wrap/unwrap and bridging) against the Uniswap Protocols. If the quote parameter includes the fee parameters, then the calldata will include the fee disbursement. The gas estimates will be more precise when the the response calldata would be valid if submitted on-chain.

Native ETH / UniswapX setup: When x-erc20eth-enabled is true and the input token is native ETH, the response may include an additional native approval call (e.g. an approveNative step) to enable ERC20-ETH (EIP-7914) spending for the wallet. This native allowance is a prerequisite for native ETH input on UniswapX (/quote then /order) for supported wallets.

npx skills add uniswap/uniswap-ai --skill swap-integration

Full swap flow integration for apps. Works with Claude Code, Cursor, and other AI coding tools.

Get a QuoteThis endpoint requires a quote response from the Quote API.

Authorization

x-api-keystringrequiredheader
Playground key
You're using a shared playground keyCreate a free account and get your own API keys from the dashboard.
Get your keys

Headers

x-universal-router-versionenumdefault:2.1.2
2.02.1.12.1.22.2.0

The version of the Universal Router to use for the swap journey. *MUST* be consistent throughout the API calls.

x-erc20eth-enabledbooleandefault:false

Enable native ETH input support for UniswapX via ERC20-ETH (EIP-7914). When set to true and tokenIn is the native currency address (e.g. 0x0000000000000000000000000000000000000000), the API may return UniswapX routes that spend native ETH for supported wallets.

x-agent-infostring

Optional attribution hint for AI-agent traffic; send it if an AI agent built or operates your integration. The value is a JSON object with up to three fields: decision_origin (required, exactly autonomous or human_mediated, case-sensitive), integration_name (optional string naming your integration, e.g. my-trading-bot), and version (optional string identifying your integration's version). Any other key is dropped, never rejected. The raw value must be at most 1024 bytes of printable US-ASCII (0x20-0x7E), so send non-ASCII text as JSON \u escapes; integration_name and version are each limited to 256 UTF-16 code units and may not contain control characters, U+2028, U+2029, or U+FFFD. Send the header once: repeated header lines are joined with , and the joined string is what gets parsed, so two complete objects fail as invalid JSON while a single object split across two lines still parses. The header is analytics-only and never affects the request: omitting it, sending it, or sending a value that fails these rules never changes the response status, body, or swap behavior. A value that fails to parse is dropped and reported by the x-agent-info-status response header. Never put a user ID, wallet address, email, session token, or API key in these fields.

Body

application/json
smartContractDelegationAddressstring
includeGasInfobooleandefault:false
deadlinenumber

The unix timestamp at which the order will be reverted if not filled.

simulateTransactionboolean

Response

Create 7702 swap successful.

requestIdstringrequired

A unique ID for the request.

swapobjectrequired
gasFeestring

The total estimated gas cost of this transaction (eg. gasLimit multiplied by maxFeePerGas) in the base unit of the chain.