Uniswap Get a quote
Retrieve a quote with the Uniswap API. Supply an amount and a swapper. Sample fields include token information and addresses. Use it for on-chain or crypto market research. Use the response in a DeFi workflow for the selected protocol, and compare the request and response with the provider example.
- Selected price
- $0 / callPublished pricing
- Sellers / APIs
- 1 / 1
- Requests · 30d
- —Loading...
- Success rate · 30d
- —Loading...
Uniswap Get a quote
Prepare your request, then continue with your agent.
Selected price
$0 / call
- Provider
- Pricing
On this page
Playground
Run sends a real API request. Charges follow the published API contract.
Response structure
isTokenApprovalApplicablebooleanpermitDataobjectdomainobjectchainIdintegernamestringverifyingContractstring
typesobjectPermitDetailsobject[]namestringtypestring
PermitSingleobject[]namestringtypestring
valuesobjectdetailsobjectamountstringexpirationstringnoncestringtokenstring
sigDeadlinestringspenderstring
permitTransactionnullquoteobjectaggregatedOutputsobject[]amountstringbpsintegerminAmountstringrecipientstringtokenstring
blockNumberstringchainIdintegergasEstimatesobject[]gasFeestringgasLimitstringmaxFeePerGasstringmaxPriorityFeePerGasstringstrategyobjectbaseFeeHistoryWindowintegerbaseFeeMultipliernumberlimitInflationFactornumbermaxPriorityFeeGweinumberminPriorityFeeGweiintegerminPriorityFeeRatioOfBaseFeenumberpercentileThresholdFor1559FeeintegerpriceInflationFactorintegerthresholdToInflateLastBlockBaseFeeinteger
typestring
gasFeestringgasFeeQuotestringgasFeeUSDstringgasUseEstimatestringinputobjectamountstringmaximumAmountstringtokenstring
maxFeePerGasstringmaxPriorityFeePerGasstringoutputobjectamountstringminimumAmountstringrecipientstringtokenstring
priceDifferencenumberpriceImpactnumberquoteIdstringrouteobject[][]addressstringamountInstringamountOutstringfeestringliquiditystringsqrtRatioX96stringtickCurrentstringtokenInobjectaddressstringchainIdintegerdecimalsstringsymbolstring
tokenOutobjectaddressstringchainIdintegerdecimalsstringsymbolstring
typestring
routeGraphobjectpoolsobject[]addressstringfeestringprotocolstringshareOfInputBpsintegertokenInobjectaddressstringchainIdintegersymbolstring
tokenOutobjectaddressstringchainIdintegerdecimalsstringsymbolstring
routeStringstringslippagenumberswapperstringtradeTypestringtxFailureReasonsunknown[]
requestIdstringroutingstring
// Inferred from response examples. Fields are optional and other fields may be returned.
export type ApiResponse = {
isTokenApprovalApplicable?: boolean;
permitData?: {
domain?: {
chainId?: number;
name?: string;
verifyingContract?: string;
};
types?: {
PermitDetails?: Array<{
name?: string;
type?: string;
}>;
PermitSingle?: Array<{
name?: string;
type?: string;
}>;
};
values?: {
details?: {
amount?: string;
expiration?: string;
nonce?: string;
token?: string;
};
sigDeadline?: string;
spender?: string;
};
};
permitTransaction?: null;
quote?: {
aggregatedOutputs?: Array<{
amount?: string;
bps?: number;
minAmount?: string;
recipient?: string;
token?: string;
}>;
blockNumber?: string;
chainId?: number;
gasEstimates?: Array<{
gasFee?: string;
gasLimit?: string;
maxFeePerGas?: string;
maxPriorityFeePerGas?: string;
strategy?: {
baseFeeHistoryWindow?: number;
baseFeeMultiplier?: number;
limitInflationFactor?: number;
maxPriorityFeeGwei?: number;
minPriorityFeeGwei?: number;
minPriorityFeeRatioOfBaseFee?: number;
percentileThresholdFor1559Fee?: number;
priceInflationFactor?: number;
thresholdToInflateLastBlockBaseFee?: number;
};
type?: string;
}>;
gasFee?: string;
gasFeeQuote?: string;
gasFeeUSD?: string;
gasUseEstimate?: string;
input?: {
amount?: string;
maximumAmount?: string;
token?: string;
};
maxFeePerGas?: string;
maxPriorityFeePerGas?: string;
output?: {
amount?: string;
minimumAmount?: string;
recipient?: string;
token?: string;
};
priceDifference?: number;
priceImpact?: number;
quoteId?: string;
route?: Array<Array<{
address?: string;
amountIn?: string;
amountOut?: string;
fee?: string;
liquidity?: string;
sqrtRatioX96?: string;
tickCurrent?: string;
tokenIn?: {
address?: string;
chainId?: number;
decimals?: string;
symbol?: string;
};
tokenOut?: {
address?: string;
chainId?: number;
decimals?: string;
symbol?: string;
};
type?: string;
}>>;
routeGraph?: {
pools?: Array<{
address?: string;
fee?: string;
protocol?: string;
shareOfInputBps?: number;
tokenIn?: {
address?: string;
chainId?: number;
symbol?: string;
};
tokenOut?: {
address?: string;
chainId?: number;
decimals?: string;
symbol?: string;
};
}>;
};
routeString?: string;
slippage?: number;
swapper?: string;
tradeType?: string;
txFailureReasons?: Array<unknown>;
};
requestId?: string;
routing?: string;
};Sellers
| Seller | Pricing | Requests · 30d | Performance | Access |
|---|---|---|---|---|
uniswapCurrent Uniswap Get a quote · POST · View API reference | $0 / call | — | —successP50— |
- Unit price
- $0
Statistics use persisted gateway logs from the last 30 days up to now, including today.
Success rate = successful requests / all requests;
P50 = median latency of successful requests.
Prices reflect the published API contract. Contract revision: 4. Price update time: not supplied.
Total $0
API
- Method
- POST
- Endpoint
https://api.openany.si/v1/agent-apis/uniswap/v1/quote- Content type
- application/json
- Authentication
Authorization: Bearer $OPENANY_API_KEY
curl \
'https://api.openany.si/v1/agent-apis/uniswap/v1/quote' \
-X POST \
-H "Authorization: Bearer $OPENANY_API_KEY" \
-H 'Content-Type: application/json' \
-H 'x-api-experimental: false' \
-H 'x-erc20eth-enabled: false' \
-H 'x-permit2-disabled: false' \
-H 'x-universal-router-version: 2.1.2' \
--data-raw '{
"amount": "1000000000",
"slippageTolerance": 0.5,
"swapper": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"tokenIn": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"tokenInChainId": 1,
"tokenOut": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"tokenOutChainId": 1,
"type": "EXACT_INPUT"
}'Input parameters
Fields in this listing; additional options and input encoding can vary by provider.
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
x-universal-router-version | Request headersheaders | string | No | The version of the Universal Router to use for the swap journey. *MUST* be consistent throughout the API calls. enum: "2.0", "2.1.1", "2.1.2" |
x-erc20eth-enabled | Request headersheaders | boolean | No | 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-permit2-disabled | Request headersheaders | boolean | No | Disables the Permit2 approval flow. When set to `true`, `permitData` is returned as `null` and the header is forwarded to the routing layer for correct gas simulation against the Proxy Universal Router contract. When `false` or omitted, the standard Permit2 approval flow is used. This header is intended for integrators whose infrastructure uses a direct approval-then-swap pattern without Permit2. |
x-agent-info | Request headersheaders | string | No | 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. maxLength: 1024 |
amount | JSON request bodybody | string | Yes | pattern: ^[0-9]+$ |
autoSlippage | JSON request bodybody | string | No | enum: "DEFAULT" |
enforceExactIn | JSON request bodybody | boolean | No | |
generatePermitAsTransaction | JSON request bodybody | boolean | No | |
hooksOptions | JSON request bodybody | string | No | enum: "V4_HOOKS_INCLUSIVE", "V4_HOOKS_ONLY", "V4_NO_HOOKS" |
includeRouteCandidates | JSON request bodybody | boolean | No | |
integratorFees | JSON request bodybody | array | No | maxItems: 4 Nested fields and variants
Nested fields and variants
|
permitAmount | JSON request bodybody | string | No | enum: "FULL", "EXACT" |
protocols | JSON request bodybody | array | No | Nested fields and variants
|
recipient | JSON request bodybody | string | No | pattern: ^(0x)?[0-9a-fA-F]{40}$ |
routingPreference | JSON request bodybody | string | No | enum: "BEST_PRICE", "FASTEST" |
slippageTolerance | JSON request bodybody | number | No | minimum: 0 · maximum: 100 · pattern: ^[0-9]{0,3}\.?[0-9]{0,2}$ |
spreadOptimization | JSON request bodybody | string | No | enum: "EXECUTION", "PRICE" |
swapSource | JSON request bodybody | string | No | enum: "UNIVERSAL_ROUTER", "WALLET" |
swapper | JSON request bodybody | string | Yes | pattern: ^0x[0-9a-fA-F]{40}$ |
tokenIn | JSON request bodybody | string | Yes | pattern: ^(0x)?[0-9a-fA-F]{40}$ |
tokenInChainId | JSON request bodybody | number | Yes | enum: 1, 10, 56, 130, 137, 143, 196, 324, 480, 1868, 4217, 4326, 4663, 5042, 8453, 10143, 42161, 42220, 43114, 57073, 59144, 81457, 7777777, 1301, 84532, 11155111 |
tokenOut | JSON request bodybody | string | Yes | pattern: ^(0x)?[0-9a-fA-F]{40}$ |
tokenOutChainId | JSON request bodybody | number | Yes | enum: 1, 10, 56, 130, 137, 143, 196, 324, 480, 1868, 4217, 4326, 4663, 5042, 8453, 10143, 42161, 42220, 43114, 57073, 59144, 81457, 7777777, 1301, 84532, 11155111 |
type | JSON request bodybody | string | Yes | enum: "EXACT_INPUT", "EXACT_OUTPUT" |
urgency | JSON request bodybody | string | object | No | Nested fields and variantsobjectNested fields and variants
|
x-api-experimental | Request headersheaders | string | No | Requests Guidestar routing. Requires x-universal-router-swapsteps: true. Supported for EXACT_INPUT quotes on Ethereum (1), Base (8453), and Robinhood Chain (4663); any other request, including one without the swap steps header, returns a 400 InputValidationError. A Guidestar request does not fall back to standard routing: if Guidestar cannot produce a quote, the request returns a 404. Guidestar routing is in beta and its behavior may change. Omitting the header or setting it to false keeps standard routing. |
Required markers inside a nested object or variant apply when that object or variant is used.
Sample response
Sample response · Documented HTTP 200 Published documentation example. Verify the actual response after an approved call.
{
"isTokenApprovalApplicable": true,
"permitData": {
"domain": {
"chainId": 1,
"name": "Permit2",
"verifyingContract": "0x000000000022D473030F116dDEE9F6B43aC78BA3"
},
"types": {
"PermitDetails": [
{
"name": "token",
"type": "address"
},
{
"name": "amount",
"type": "uint160"
},
{
"name": "expiration",
"type": "uint48"
},
{
"name": "nonce",
"type": "uint48"
}
],
"PermitSingle": [
{
"name": "details",
"type": "PermitDetails"
},
{
"name": "spender",
"type": "address"
},
{
"name": "sigDeadline",
"type": "uint256"
}
]
},
"values": {
"details": {
"amount": "1461501637330902918203684832716283019655932542975",
"expiration": "1795920367",
"nonce": "0",
"token": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
},
"sigDeadline": "1793330167",
"spender": "0x23617e59A5925b2A4Bf75d73ff6711cD0b29De85"
}
},
"permitTransaction": null,
"quote": {
"aggregatedOutputs": [
{
"amount": "452028786877263669",
"bps": 10000,
"minAmount": "449768642942877350",
"recipient": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"token": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
}
],
"blockNumber": "26302668",
"chainId": 1,
"gasEstimates": [
{
"gasFee": "583921232742120",
"gasLimit": "219765",
"maxFeePerGas": "2657025608",
"maxPriorityFeePerGas": "10000",
"strategy": {
"baseFeeHistoryWindow": 100,
"baseFeeMultiplier": 1.05,
"limitInflationFactor": 1.15,
"maxPriorityFeeGwei": 1.8,
"minPriorityFeeGwei": 1,
"minPriorityFeeRatioOfBaseFee": 0.2,
"percentileThresholdFor1559Fee": 25,
"priceInflationFactor": 1,
"thresholdToInflateLastBlockBaseFee": 0
},
"type": "eip1559"
}
],
"gasFee": "390582764376000",
"gasFeeQuote": "290685421509000",
"gasFeeUSD": "0.644168702100876626",
"gasUseEstimate": "147000",
"input": {
"amount": "1000000000",
"maximumAmount": "1000000000",
"token": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
},
"maxFeePerGas": "2657025608",
"maxPriorityFeePerGas": "10000",
"output": {
"amount": "452028786877263669",
"minimumAmount": "449768642942877350",
"recipient": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"token": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
},
"priceDifference": 0.01,
"priceImpact": 0.01,
"quoteId": "01a18ab3-4701-8000-a876-aa54552d0100",
"route": [
[
{
"address": "0xE0554a476A092703abdB3Ef35c80e0D76d32939F",
"amountIn": "1000000000",
"amountOut": "452028786877263669",
"fee": "100",
"liquidity": "6919614899261897129",
"sqrtRatioX96": "1684554294950981473169371341752104",
"tickCurrent": "199303",
"tokenIn": {
"address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"chainId": 1,
"decimals": "6",
"symbol": "USDC"
},
"tokenOut": {
"address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"chainId": 1,
"decimals": "18",
"symbol": "WETH"
},
"type": "v3-pool"
}
]
],
"routeGraph": {
"pools": [
{
"address": "0xE0554a476A092703abdB3Ef35c80e0D76d32939F",
"fee": "100",
"protocol": "V3",
"shareOfInputBps": 10000,
"tokenIn": {
"address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"chainId": 1,
"symbol": "USDC"
},
"tokenOut": {
"address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"chainId": 1,
"decimals": "18",
"symbol": "WETH"
}
}
]
},
"routeString": "[v3] 100.00% = [0.01%] 0xE0554a476A092703abdB3Ef35c80e0D76d32939F",
"slippage": 0.5,
"swapper": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"tradeType": "EXACT_INPUT",
"txFailureReasons": []
},
"requestId": "fc5a8c7c61d8e6fb8d5217ce796daf4b",
"routing": "CLASSIC"
}Agent integration
Copy the resource contract without sharing an API key.
View API Markdown
# Uniswap Get a quote
Retrieve a quote with the Uniswap API. Supply an amount and a swapper. Sample fields include token information and addresses. Use it for on-chain or crypto market research. Use the response in a DeFi workflow for the selected protocol, and compare the request and response with the provider example.
Documentation: https://openany.si/apis/2419fb7a-cc45-44ed-8a7e-8cd9f877be0c
Method: POST
Endpoint: https://api.openany.si/v1/agent-apis/uniswap/v1/quote
Price: $0 / call
Provider: uniswap
Contract revision: 4
Price source: OpenAny public API contract and documented provider unit rates. Price update time: not supplied.
Use OPENANY_API_KEY from the environment. API Key calls use your shared balance.
## Prepared request
```bash
curl \
'https://api.openany.si/v1/agent-apis/uniswap/v1/quote' \
-X POST \
-H "Authorization: Bearer $OPENANY_API_KEY" \
-H 'Content-Type: application/json' \
-H 'x-api-experimental: false' \
-H 'x-erc20eth-enabled: false' \
-H 'x-permit2-disabled: false' \
-H 'x-universal-router-version: 2.1.2' \
--data-raw '{
"amount": "1000000000",
"slippageTolerance": 0.5,
"swapper": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"tokenIn": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"tokenInChainId": 1,
"tokenOut": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"tokenOutChainId": 1,
"type": "EXACT_INPUT"
}'
```
## API contract
```json
{
"resource_type": "api",
"name": "Uniswap Get a quote",
"endpoint": "https://api.openany.si/v1/agent-apis/uniswap/v1/quote",
"method": "POST",
"content_type": "application/json",
"execution_mode": "sync",
"authentication": {
"type": "bearer",
"environment_variable": "OPENANY_API_KEY"
},
"inputs": [
{
"description": "The version of the Universal Router to use for the swap journey. *MUST* be consistent throughout the API calls.",
"enum_values": [
"2.0",
"2.1.1",
"2.1.2"
],
"location": "header",
"name": "x-universal-router-version",
"nullable": false,
"required": false,
"type": "string"
},
{
"description": "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.",
"location": "header",
"name": "x-erc20eth-enabled",
"nullable": false,
"required": false,
"type": "boolean"
},
{
"description": "Disables the Permit2 approval flow. When set to `true`, `permitData` is returned as `null` and the header is forwarded to the routing layer for correct gas simulation against the Proxy Universal Router contract. When `false` or omitted, the standard Permit2 approval flow is used. This header is intended for integrators whose infrastructure uses a direct approval-then-swap pattern without Permit2.",
"location": "header",
"name": "x-permit2-disabled",
"nullable": false,
"required": false,
"type": "boolean"
},
{
"description": "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.",
"location": "header",
"max_length": 1024,
"name": "x-agent-info",
"nullable": false,
"required": false,
"type": "string"
},
{
"description": "Complete public Uniswap request body. Internal fields are prohibited. Source-only annotations are kept in the raw OpenAPI snapshot.",
"json_schema": {
"allOf": [
{
"not": {
"anyOf": [
{
"required": [
"walletExecutionContext"
]
},
{
"required": [
"earnIntent"
]
},
{
"required": [
"bridgeProviders"
]
}
]
}
},
{
"oneOf": [
{
"required": [
"slippageTolerance"
]
},
{
"required": [
"autoSlippage"
]
}
]
}
],
"description": "Complete public Uniswap request body. Internal fields are prohibited. Source-only annotations are kept in the raw OpenAPI snapshot.",
"properties": {
"amount": {
"pattern": "^[0-9]+$",
"type": "string"
},
"autoSlippage": {
"enum": [
"DEFAULT"
],
"type": "string"
},
"enforceExactIn": {
"type": "boolean"
},
"generatePermitAsTransaction": {
"type": "boolean"
},
"hooksOptions": {
"enum": [
"V4_HOOKS_INCLUSIVE",
"V4_HOOKS_ONLY",
"V4_NO_HOOKS"
],
"type": "string"
},
"includeRouteCandidates": {
"type": "boolean"
},
"integratorFees": {
"items": {
"properties": {
"bips": {
"exclusiveMinimum": 0,
"maximum": 500,
"type": "number"
},
"recipient": {
"pattern": "^0x[a-fA-F0-9]{40}$",
"type": "string"
}
},
"required": [
"bips",
"recipient"
],
"type": "object"
},
"maxItems": 4,
"type": "array"
},
"permitAmount": {
"enum": [
"FULL",
"EXACT"
],
"type": "string"
},
"protocols": {
"items": {
"enum": [
"V2",
"V3",
"V4",
"UNISWAPX",
"UNISWAPX_V2",
"UNISWAPX_V3",
"UNISWAPX_LATEST"
],
"type": "string"
},
"type": "array"
},
"recipient": {
"pattern": "^(0x)?[0-9a-fA-F]{40}$",
"type": "string"
},
"routingPreference": {
"enum": [
"BEST_PRICE",
"FASTEST"
],
"type": "string"
},
"slippageTolerance": {
"maximum": 100,
"minimum": 0,
"pattern": "^[0-9]{0,3}\\.?[0-9]{0,2}$",
"type": "number"
},
"spreadOptimization": {
"enum": [
"EXECUTION",
"PRICE"
],
"type": "string"
},
"swapSource": {
"enum": [
"UNIVERSAL_ROUTER",
"WALLET"
],
"type": "string"
},
"swapper": {
"pattern": "^0x[0-9a-fA-F]{40}$",
"type": "string"
},
"tokenIn": {
"pattern": "^(0x)?[0-9a-fA-F]{40}$",
"type": "string"
},
"tokenInChainId": {
"enum": [
1,
10,
56,
130,
137,
143,
196,
324,
480,
1868,
4217,
4326,
4663,
5042,
8453,
10143,
42161,
42220,
43114,
57073,
59144,
81457,
7777777,
1301,
84532,
11155111
],
"type": "number"
},
"tokenOut": {
"pattern": "^(0x)?[0-9a-fA-F]{40}$",
"type": "string"
},
"tokenOutChainId": {
"enum": [
1,
10,
56,
130,
137,
143,
196,
324,
480,
1868,
4217,
4326,
4663,
5042,
8453,
10143,
42161,
42220,
43114,
57073,
59144,
81457,
7777777,
1301,
84532,
11155111
],
"type": "number"
},
"type": {
"enum": [
"EXACT_INPUT",
"EXACT_OUTPUT"
],
"type": "string"
},
"urgency": {
"oneOf": [
{
"enum": [
"normal",
"fast",
"urgent"
],
"type": "string"
},
{
"properties": {
"level": {
"enum": [
"normal",
"fast",
"urgent"
],
"type": "string"
},
"overrides": {
"properties": {
"gasLimit": {
"type": "string"
},
"maxFeePerGas": {
"type": "string"
},
"maxPriorityFeePerGas": {
"type": "string"
}
},
"type": "object"
}
},
"required": [
"level"
],
"type": "object"
}
]
}
},
"required": [
"type",
"amount",
"tokenInChainId",
"tokenOutChainId",
"tokenIn",
"tokenOut",
"swapper"
],
"type": "object"
},
"location": "body",
"name": "body",
"nullable": false,
"pointer": "",
"required": true,
"type": "object"
},
{
"description": "Requests Guidestar routing. Requires x-universal-router-swapsteps: true. Supported for EXACT_INPUT quotes on Ethereum (1), Base (8453), and Robinhood Chain (4663); any other request, including one without the swap steps header, returns a 400 InputValidationError. A Guidestar request does not fall back to standard routing: if Guidestar cannot produce a quote, the request returns a 404. Guidestar routing is in beta and its behavior may change. Omitting the header or setting it to false keeps standard routing.",
"location": "header",
"name": "x-api-experimental",
"nullable": false,
"required": false,
"type": "string"
}
],
"billing": {
"currency": "USD",
"mode": "fixed",
"priceMicroUsd": "0",
"rounding": null,
"unit": "call",
"unitQuantity": null
},
"examples": [
{
"http_status": 200,
"name": "quote",
"request": {
"body": {
"amount": "1000000000",
"slippageTolerance": 0.5,
"swapper": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"tokenIn": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"tokenInChainId": 1,
"tokenOut": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"tokenOutChainId": 1,
"type": "EXACT_INPUT"
},
"headers": {
"x-api-experimental": "false",
"x-erc20eth-enabled": "false",
"x-permit2-disabled": "false",
"x-universal-router-version": "2.1.2"
},
"path": {},
"query": {}
},
"response_body": {
"isTokenApprovalApplicable": true,
"permitData": {
"domain": {
"chainId": 1,
"name": "Permit2",
"verifyingContract": "0x000000000022D473030F116dDEE9F6B43aC78BA3"
},
"types": {
"PermitDetails": [
{
"name": "token",
"type": "address"
},
{
"name": "amount",
"type": "uint160"
},
{
"name": "expiration",
"type": "uint48"
},
{
"name": "nonce",
"type": "uint48"
}
],
"PermitSingle": [
{
"name": "details",
"type": "PermitDetails"
},
{
"name": "spender",
"type": "address"
},
{
"name": "sigDeadline",
"type": "uint256"
}
]
},
"values": {
"details": {
"amount": "1461501637330902918203684832716283019655932542975",
"expiration": "1795920367",
"nonce": "0",
"token": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
},
"sigDeadline": "1793330167",
"spender": "0x23617e59A5925b2A4Bf75d73ff6711cD0b29De85"
}
},
"permitTransaction": null,
"quote": {
"aggregatedOutputs": [
{
"amount": "452028786877263669",
"bps": 10000,
"minAmount": "449768642942877350",
"recipient": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"token": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
}
],
"blockNumber": "26302668",
"chainId": 1,
"gasEstimates": [
{
"gasFee": "583921232742120",
"gasLimit": "219765",
"maxFeePerGas": "2657025608",
"maxPriorityFeePerGas": "10000",
"strategy": {
"baseFeeHistoryWindow": 100,
"baseFeeMultiplier": 1.05,
"limitInflationFactor": 1.15,
"maxPriorityFeeGwei": 1.8,
"minPriorityFeeGwei": 1,
"minPriorityFeeRatioOfBaseFee": 0.2,
"percentileThresholdFor1559Fee": 25,
"priceInflationFactor": 1,
"thresholdToInflateLastBlockBaseFee": 0
},
"type": "eip1559"
}
],
"gasFee": "390582764376000",
"gasFeeQuote": "290685421509000",
"gasFeeUSD": "0.644168702100876626",
"gasUseEstimate": "147000",
"input": {
"amount": "1000000000",
"maximumAmount": "1000000000",
"token": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
},
"maxFeePerGas": "2657025608",
"maxPriorityFeePerGas": "10000",
"output": {
"amount": "452028786877263669",
"minimumAmount": "449768642942877350",
"recipient": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"token": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
},
"priceDifference": 0.01,
"priceImpact": 0.01,
"quoteId": "01a18ab3-4701-8000-a876-aa54552d0100",
"route": [
[
{
"address": "0xE0554a476A092703abdB3Ef35c80e0D76d32939F",
"amountIn": "1000000000",
"amountOut": "452028786877263669",
"fee": "100",
"liquidity": "6919614899261897129",
"sqrtRatioX96": "1684554294950981473169371341752104",
"tickCurrent": "199303",
"tokenIn": {
"address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"chainId": 1,
"decimals": "6",
"symbol": "USDC"
},
"tokenOut": {
"address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"chainId": 1,
"decimals": "18",
"symbol": "WETH"
},
"type": "v3-pool"
}
]
],
"routeGraph": {
"pools": [
{
"address": "0xE0554a476A092703abdB3Ef35c80e0D76d32939F",
"fee": "100",
"protocol": "V3",
"shareOfInputBps": 10000,
"tokenIn": {
"address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"chainId": 1,
"symbol": "USDC"
},
"tokenOut": {
"address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"chainId": 1,
"decimals": "18",
"symbol": "WETH"
}
}
]
},
"routeString": "[v3] 100.00% = [0.01%] 0xE0554a476A092703abdB3Ef35c80e0D76d32939F",
"slippage": 0.5,
"swapper": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"tradeType": "EXACT_INPUT",
"txFailureReasons": []
},
"requestId": "fc5a8c7c61d8e6fb8d5217ce796daf4b",
"routing": "CLASSIC"
}
}
]
}
```Error handling
| Status | Next step |
|---|---|
400 | Check the offering and request fields. |
401 / 403 | Verify your credentials and access permissions. |
402 | Inspect the selected access mode and returned payment requirements. |
429 | Respect the returned rate limit and retry guidance. |
5xx | Inspect the error and usage record before retrying a paid operation. |
Examples
quote
Published documentation example. Verify the actual response after an approved call.
Prepare your environment
Use a terminal with cURL installed.
Use an OpenAny API key with shared-balance access. Confirm availability and price before running; a call may charge your balance.
Set the key in your terminal using the hidden prompt below. Keep its value out of source files and logs.
Terminal · macOS / Linuxprintf 'OpenAny API key: ' read -r -s OPENANY_API_KEY export OPENANY_API_KEY printf '\n'Run the request
Paste the complete command below into your terminal.
Values to replace before running 6
Review these request fields before running. Keep the published provider and request method unchanged.
x-universal-router-version- The version of the Universal Router to use for the swap journey. *MUST* be consistent throughout the API calls.
x-erc20eth-enabled- 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-permit2-disabled- Disables the Permit2 approval flow. When set to `true`, `permitData` is returned as `null` and the header is forwarded to the routing layer for correct gas simulation against the Proxy Universal Router contract. When `false` or omitted, the standard Permit2 approval flow is used. This header is intended for integrators whose infrastructure uses a direct approval-then-swap pattern without Permit2.
x-agent-info- 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- Complete public Uniswap request body. Internal fields are prohibited. Source-only annotations are kept in the raw OpenAPI snapshot.
x-api-experimental- Requests Guidestar routing. Requires x-universal-router-swapsteps: true. Supported for EXACT_INPUT quotes on Ethereum (1), Base (8453), and Robinhood Chain (4663); any other request, including one without the swap steps header, returns a 400 InputValidationError. A Guidestar request does not fall back to standard routing: if Guidestar cannot produce a quote, the request returns a 404. Guidestar routing is in beta and its behavior may change. Omitting the header or setting it to false keeps standard routing.
Terminal · cURLcurl \ 'https://api.openany.si/v1/agent-apis/uniswap/v1/quote' \ -X POST \ -H "Authorization: Bearer $OPENANY_API_KEY" \ -H 'Content-Type: application/json' \ -H 'x-api-experimental: false' \ -H 'x-erc20eth-enabled: false' \ -H 'x-permit2-disabled: false' \ -H 'x-universal-router-version: 2.1.2' \ --data-raw '{ "amount": "1000000000", "slippageTolerance": 0.5, "swapper": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045", "tokenIn": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", "tokenInChainId": 1, "tokenOut": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", "tokenOutChainId": 1, "type": "EXACT_INPUT" }'Check the response
Sample response · Documented HTTP 200
Sample response{ "isTokenApprovalApplicable": true, "permitData": { "domain": { "chainId": 1, "name": "Permit2", "verifyingContract": "0x000000000022D473030F116dDEE9F6B43aC78BA3" }, "types": { "PermitDetails": [ { "name": "token", "type": "address" }, { "name": "amount", "type": "uint160" }, { "name": "expiration", "type": "uint48" }, { "name": "nonce", "type": "uint48" } ], "PermitSingle": [ { "name": "details", "type": "PermitDetails" }, { "name": "spender", "type": "address" }, { "name": "sigDeadline", "type": "uint256" } ] }, "values": { "details": { "amount": "1461501637330902918203684832716283019655932542975", "expiration": "1795920367", "nonce": "0", "token": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" }, "sigDeadline": "1793330167", "spender": "0x23617e59A5925b2A4Bf75d73ff6711cD0b29De85" } }, "permitTransaction": null, "quote": { "aggregatedOutputs": [ { "amount": "452028786877263669", "bps": 10000, "minAmount": "449768642942877350", "recipient": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045", "token": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" } ], "blockNumber": "26302668", "chainId": 1, "gasEstimates": [ { "gasFee": "583921232742120", "gasLimit": "219765", "maxFeePerGas": "2657025608", "maxPriorityFeePerGas": "10000", "strategy": { "baseFeeHistoryWindow": 100, "baseFeeMultiplier": 1.05, "limitInflationFactor": 1.15, "maxPriorityFeeGwei": 1.8, "minPriorityFeeGwei": 1, "minPriorityFeeRatioOfBaseFee": 0.2, "percentileThresholdFor1559Fee": 25, "priceInflationFactor": 1, "thresholdToInflateLastBlockBaseFee": 0 }, "type": "eip1559" } ], "gasFee": "390582764376000", "gasFeeQuote": "290685421509000", "gasFeeUSD": "0.644168702100876626", "gasUseEstimate": "147000", "input": { "amount": "1000000000", "maximumAmount": "1000000000", "token": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" }, "maxFeePerGas": "2657025608", "maxPriorityFeePerGas": "10000", "output": { "amount": "452028786877263669", "minimumAmount": "449768642942877350", "recipient": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045", "token": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" }, "priceDifference": 0.01, "priceImpact": 0.01, "quoteId": "01a18ab3-4701-8000-a876-aa54552d0100", "route": [ [ { "address": "0xE0554a476A092703abdB3Ef35c80e0D76d32939F", "amountIn": "1000000000", "amountOut": "452028786877263669", "fee": "100", "liquidity": "6919614899261897129", "sqrtRatioX96": "1684554294950981473169371341752104", "tickCurrent": "199303", "tokenIn": { "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", "chainId": 1, "decimals": "6", "symbol": "USDC" }, "tokenOut": { "address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", "chainId": 1, "decimals": "18", "symbol": "WETH" }, "type": "v3-pool" } ] ], "routeGraph": { "pools": [ { "address": "0xE0554a476A092703abdB3Ef35c80e0D76d32939F", "fee": "100", "protocol": "V3", "shareOfInputBps": 10000, "tokenIn": { "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", "chainId": 1, "symbol": "USDC" }, "tokenOut": { "address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", "chainId": 1, "decimals": "18", "symbol": "WETH" } } ] }, "routeString": "[v3] 100.00% = [0.01%] 0xE0554a476A092703abdB3Ef35c80e0D76d32939F", "slippage": 0.5, "swapper": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045", "tradeType": "EXACT_INPUT", "txFailureReasons": [] }, "requestId": "fc5a8c7c61d8e6fb8d5217ce796daf4b", "routing": "CLASSIC" }