Read-only DEX — 0x — Gasless firm quote — returns trade.eip712 (+ optional approval.eip712) for client to sign
Retrieve read-only DEX 0x Gasless firm quote returns trade.eip712 (+ optional approval.eip712) for client to sign with the BlockRun API. Supply a buy token and a chain ID (chainId). Sample fields include hashes and tokens. Use it in financial research or market monitoring. The GET request schema also lists buyToken, sellAmount.
- Selected price
- $0 / callPublished pricing
- Sellers / APIs
- 1 / 1
- Requests · 30d
- —Loading...
- Success rate · 30d
- —Loading...
Read-only DEX — 0x — Gasless firm quote — returns trade.eip712 (+ optional approval.eip712) for client to sign
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
allowanceTargetstringapprovalobjecteip712objectdomainobjectchainIdintegernamestringverifyingContractstringversionstring
messageobjectdeadlinestringnonceintegerownerstringspenderstringvaluestring
primaryTypestringtypesobjectEIP712Domainobject[]namestringtypestring
Permitobject[]namestringtypestring
hashstringtypestring
blockNumberstringbuyAmountstringbuyTokenstringfeesobjectgasFeeobjectamountstringtokenstringtypestring
integratorFeeobjectamountstringtokenstringtypestring
integratorFeesobject[]amountstringtokenstringtypestring
zeroExFeeobjectamountstringtokenstringtypestring
issuesobjectallowanceobjectactualstringspenderstring
balancenullinvalidSourcesPassedunknown[]simulationIncompleteboolean
liquidityAvailablebooleanminBuyAmountstringrouteobjectfillsobject[]fromstringproportionBpsstringsourcestringtostring
tokensobject[]addressstringsymbolstring
sellAmountstringsellTokenstringtargetstringtokenMetadataobjectbuyTokenobjectbuyTaxBpsstringsellTaxBpsstringtransferTaxBpsstring
sellTokenobjectbuyTaxBpsstringsellTaxBpsstringtransferTaxBpsstring
tradeobjecteip712objectdomainobjectchainIdintegernamestringverifyingContractstring
messageobjectdeadlinestringnoncestringpermittedobjectamountstringtokenstring
slippageAndActionsobjectactionsstring[]buyTokenstringminAmountOutstringrecipientstring
spenderstring
primaryTypestringtypesobjectEIP712Domainobject[]namestringtypestring
PermitWitnessTransferFromobject[]namestringtypestring
SlippageAndActionsobject[]namestringtypestring
TokenPermissionsobject[]namestringtypestring
hashstringtypestring
zidstring
// Inferred from response examples. Fields are optional and other fields may be returned.
export type ApiResponse = {
allowanceTarget?: string;
approval?: {
eip712?: {
domain?: {
chainId?: number;
name?: string;
verifyingContract?: string;
version?: string;
};
message?: {
deadline?: string;
nonce?: number;
owner?: string;
spender?: string;
value?: string;
};
primaryType?: string;
types?: {
EIP712Domain?: Array<{
name?: string;
type?: string;
}>;
Permit?: Array<{
name?: string;
type?: string;
}>;
};
};
hash?: string;
type?: string;
};
blockNumber?: string;
buyAmount?: string;
buyToken?: string;
fees?: {
gasFee?: {
amount?: string;
token?: string;
type?: string;
};
integratorFee?: {
amount?: string;
token?: string;
type?: string;
};
integratorFees?: Array<{
amount?: string;
token?: string;
type?: string;
}>;
zeroExFee?: {
amount?: string;
token?: string;
type?: string;
};
};
issues?: {
allowance?: {
actual?: string;
spender?: string;
};
balance?: null;
invalidSourcesPassed?: Array<unknown>;
simulationIncomplete?: boolean;
};
liquidityAvailable?: boolean;
minBuyAmount?: string;
route?: {
fills?: Array<{
from?: string;
proportionBps?: string;
source?: string;
to?: string;
}>;
tokens?: Array<{
address?: string;
symbol?: string;
}>;
};
sellAmount?: string;
sellToken?: string;
target?: string;
tokenMetadata?: {
buyToken?: {
buyTaxBps?: string;
sellTaxBps?: string;
transferTaxBps?: string;
};
sellToken?: {
buyTaxBps?: string;
sellTaxBps?: string;
transferTaxBps?: string;
};
};
trade?: {
eip712?: {
domain?: {
chainId?: number;
name?: string;
verifyingContract?: string;
};
message?: {
deadline?: string;
nonce?: string;
permitted?: {
amount?: string;
token?: string;
};
slippageAndActions?: {
actions?: Array<string>;
buyToken?: string;
minAmountOut?: string;
recipient?: string;
};
spender?: string;
};
primaryType?: string;
types?: {
EIP712Domain?: Array<{
name?: string;
type?: string;
}>;
PermitWitnessTransferFrom?: Array<{
name?: string;
type?: string;
}>;
SlippageAndActions?: Array<{
name?: string;
type?: string;
}>;
TokenPermissions?: Array<{
name?: string;
type?: string;
}>;
};
};
hash?: string;
type?: string;
};
zid?: string;
};Sellers
| Seller | Pricing | Requests · 30d | Performance | Access |
|---|---|---|---|---|
blockrunCurrent Read-only DEX — 0x — Gasless firm quote — returns trade.eip712 (+ optional approval.eip712) for client to sign · GET · 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
- GET
- Endpoint
https://api.openany.si/v1/agent-apis/blockrun/api/v1/zerox/gasless/quote- Content type
- application/json
- Authentication
Authorization: Bearer $OPENANY_API_KEY
curl \
'https://api.openany.si/v1/agent-apis/blockrun/api/v1/zerox/gasless/quote?buyToken=0x4200000000000000000000000000000000000006&chainId=8453&sellAmount=10000000&sellToken=0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913&taker=0x1111111111111111111111111111111111111111' \
-X GET \
-H "Authorization: Bearer $OPENANY_API_KEY" \
-H 'Content-Type: application/json'Input parameters
Fields in this listing; additional options and input encoding can vary by provider.
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
buyToken | URL query parametersquery | string | Yes | The contract address of the token to buy |
chainId | URL query parametersquery | integer | Yes | Chain ID. See [here](https://docs.0x.org/docs/introduction/supported-chains) for the list of supported chains |
excludedSources | URL query parametersquery | string | No | Liquidity sources e.g. Uniswap_V3, SushiSwap, 0x_RFQ to exclude from the provided quote. See `https://api.0x.org/sources?chainId=<chain_id>` with the desired chain's ID for a full list of sources. Separate multiple sources with a comma |
recipient | URL query parametersquery | string | No | The address to receive the `buyToken`. If not provided, defaults to the taker address. Not supported for wrap/unwrap operations. |
sellAmount | URL query parametersquery | string | Yes | The amount of `sellToken` in `sellToken` base units to sell |
sellToken | URL query parametersquery | string | Yes | The contract address of the token to sell. Native token is not supported |
slippageBps | URL query parametersquery | integer | No | The maximum acceptable slippage of the `buyToken` in Bps. 0x sets the optimal slippage tolerance per trade by default. To mitigate the risk of MEV attacks, we recommend adjusting this value only when trading low-liquidity tokens. Deprecated: use `slippagePpm` instead. `slippageBps` accepts only whole numbers. minimum: 30 · maximum: 10000 |
slippagePpm | URL query parametersquery | integer | No | The maximum acceptable slippage of the `buyToken` in parts-per-million (PPM). Mutually exclusive with `slippageBps`. e.g. 3000 PPM = 30 BPS = 0.30%. minimum: 0 · maximum: 1000000 |
taker | URL query parametersquery | string | Yes | The address which holds the `sellToken` balance and has the allowance set for the swap |
tradeSurplusMaxBps | URL query parametersquery | integer | No | The maximum trade surplus (positive slippage) that can be collected in Bps of the buy amount. If not provided, defaults to 10000 (100%). Must be used together with `tradeSurplusRecipient`. Mutually exclusive with `tradeSurplusMaxPpm`. minimum: 1 · maximum: 10000 |
tradeSurplusMaxPpm | URL query parametersquery | integer | No | The maximum trade surplus (positive slippage) that can be collected in parts-per-million (PPM) of the buy amount. Mutually exclusive with `tradeSurplusMaxBps`. If not provided, defaults to 1000000 (100%). Must be used together with `tradeSurplusRecipient`. e.g. 5000 PPM = 50 BPS = 0.5%. minimum: 1 · maximum: 1000000 |
tradeSurplusRecipient | URL query parametersquery | string | No | The address to receive any trade surplus. If specified, this address will receive trade surplus when applicable. Otherwise, the taker will receive the surplus. This feature is only available to selected integrators on a custom pricing plan. In other cases, the surplus will be collected by 0x. For assistance with a custom plan, please contact support. |
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.
{
"allowanceTarget": "0x000000000022d473030f116ddee9f6b43ac78ba3",
"approval": {
"eip712": {
"domain": {
"chainId": 8453,
"name": "USD Coin",
"verifyingContract": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"version": "2"
},
"message": {
"deadline": "1793535479",
"nonce": 0,
"owner": "0x1111111111111111111111111111111111111111",
"spender": "0x000000000022d473030f116ddee9f6b43ac78ba3",
"value": "115792089237316195423570985008687907853269984665640564039457584007913129639935"
},
"primaryType": "Permit",
"types": {
"EIP712Domain": [
{
"name": "name",
"type": "string"
},
{
"name": "version",
"type": "string"
},
{
"name": "chainId",
"type": "uint256"
},
{
"name": "verifyingContract",
"type": "address"
}
],
"Permit": [
{
"name": "owner",
"type": "address"
},
{
"name": "spender",
"type": "address"
},
{
"name": "value",
"type": "uint256"
},
{
"name": "nonce",
"type": "uint256"
},
{
"name": "deadline",
"type": "uint256"
}
]
}
},
"hash": "0x858cb13d3c27b785c46aba8c4aa1c93ee3a01198651eb41d3132c41760b9b7e3",
"type": "permit"
},
"blockNumber": "53329866",
"buyAmount": "4436068845652620",
"buyToken": "0x4200000000000000000000000000000000000006",
"fees": {
"gasFee": {
"amount": "7026",
"token": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"type": "gas"
},
"integratorFee": {
"amount": "20000",
"token": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"type": "volume"
},
"integratorFees": [
{
"amount": "20000",
"token": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"type": "volume"
}
],
"zeroExFee": {
"amount": "15000",
"token": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"type": "volume"
}
},
"issues": {
"allowance": {
"actual": "0",
"spender": "0x000000000022d473030f116ddee9f6b43ac78ba3"
},
"balance": null,
"invalidSourcesPassed": [],
"simulationIncomplete": false
},
"liquidityAvailable": true,
"minBuyAmount": "4422760639115662",
"route": {
"fills": [
{
"from": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"proportionBps": "10000",
"source": "LunarBase",
"to": "0x4200000000000000000000000000000000000006"
}
],
"tokens": [
{
"address": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"symbol": "USDC"
},
{
"address": "0x4200000000000000000000000000000000000006",
"symbol": "WETH"
}
]
},
"sellAmount": "10000000",
"sellToken": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"target": "0xca11bde05977b3631167028862be2a173976ca11",
"tokenMetadata": {
"buyToken": {
"buyTaxBps": "0",
"sellTaxBps": "0",
"transferTaxBps": "0"
},
"sellToken": {
"buyTaxBps": "0",
"sellTaxBps": "0",
"transferTaxBps": "0"
}
},
"trade": {
"eip712": {
"domain": {
"chainId": 8453,
"name": "Permit2",
"verifyingContract": "0x000000000022d473030f116ddee9f6b43ac78ba3"
},
"message": {
"deadline": "1793449379",
"nonce": "2241959297937691820908574931991871",
"permitted": {
"amount": "10000000",
"token": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"
},
"slippageAndActions": {
"actions": [
"0x0dfeb419000000000000000000000000f22785087a4d1105c4ceb009305fc164f4d3358e000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda0291300000000000000000000000000000000000000000000000000000000009896800000000000000000000000000000000000006e898131631616b1779bad70bd3f000000000000000000000000000000000000000000000000000000006ae5dda3",
"0x38c9c147000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda0291300000000000000000000000000000000000000000000000000000000000002bc000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000044a9059cbb0000000000000000000000009f6601854dee374b1bfaf6350ffd27a97309d431000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"0x38c9c147000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda0291300000000000000000000000000000000000000000000000000000000000007d0000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000044a9059cbb000000000000000000000000e9030014f5dae217d0a152f02a043567b16c1abf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"0x38c9c147000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda0291300000000000000000000000000000000000000000000000000000000000005dc000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000044a9059cbb0000000000000000000000009f6601854dee374b1bfaf6350ffd27a97309d431000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"0x38c9c147000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda0291300000000000000000000000000000000000000000000000000000000000f42400000000000000000000000000000efc4ec03a7c47d3a38a9be7ff1d52dd01b99000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000c425d2e751000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda029130000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f22785087a4d1105c4ceb009305fc164f4d3358e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e31a7b317c03c000000000000000000000000000000000000000000000000000000006ae5dda300000000000000000000000000000000000000000000000000000000",
"0x38c9c147000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee00000000000000000000000000000000000000000000000000000000000f42400000000000000000000000004200000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000024d0e30db0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"0x5f80abae000000000000000000000000f5c4f3dc02c3fb9279495a8fef7b0741da9561570000000000000000000000004200000000000000000000000000000000000006000000000000000000000000000000000000000000000000000fc2f3d6b9b1c100000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f4240"
],
"buyToken": "0x4200000000000000000000000000000000000006",
"minAmountOut": "4422760639115662",
"recipient": "0x1111111111111111111111111111111111111111"
},
"spender": "0xf22785087a4d1105c4ceb009305fc164f4d3358e"
},
"primaryType": "PermitWitnessTransferFrom",
"types": {
"EIP712Domain": [
{
"name": "name",
"type": "string"
},
{
"name": "chainId",
"type": "uint256"
},
{
"name": "verifyingContract",
"type": "address"
}
],
"PermitWitnessTransferFrom": [
{
"name": "permitted",
"type": "TokenPermissions"
},
{
"name": "spender",
"type": "address"
},
{
"name": "nonce",
"type": "uint256"
},
{
"name": "deadline",
"type": "uint256"
},
{
"name": "slippageAndActions",
"type": "SlippageAndActions"
}
],
"SlippageAndActions": [
{
"name": "recipient",
"type": "address"
},
{
"name": "buyToken",
"type": "address"
},
{
"name": "minAmountOut",
"type": "uint256"
},
{
"name": "actions",
"type": "bytes[]"
}
],
"TokenPermissions": [
{
"name": "token",
"type": "address"
},
{
"name": "amount",
"type": "uint256"
}
]
}
},
"hash": "0x2a478b4dda4ececd55c3cdf112c44d43201d6c3485412fb97ab03b7bcb0aabe2",
"type": "settler_metatransaction"
},
"zid": "0x141a47490f760eaf1c30d2a5"
}Agent integration
Copy the resource contract without sharing an API key.
View API Markdown
# Read-only DEX — 0x — Gasless firm quote — returns trade.eip712 (+ optional approval.eip712) for client to sign
Retrieve read-only DEX 0x Gasless firm quote returns trade.eip712 (+ optional approval.eip712) for client to sign with the BlockRun API. Supply a buy token and a chain ID (chainId). Sample fields include hashes and tokens. Use it in financial research or market monitoring. The GET request schema also lists buyToken, sellAmount.
## Available implementations
blockrun · Read-only DEX — 0x — Gasless firm quote — returns trade.eip712 (+ optional approval.eip712) for client to sign: https://openany.si/markets/apis/capabilities/blockrun-read-only-dex-0x-gasless-firm-quote-returns-trade-eip712-optional-approval-eip712-for-c?offering=c7da9b5f-ed64-4379-a2ca-b9226e80c298 · $0 / call
## Selected API contract
Documentation: https://openany.si/markets/apis/capabilities/blockrun-read-only-dex-0x-gasless-firm-quote-returns-trade-eip712-optional-approval-eip712-for-c
Method: GET
Endpoint: https://api.openany.si/v1/agent-apis/blockrun/api/v1/zerox/gasless/quote
Price: $0 / call
Provider: blockrun
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/blockrun/api/v1/zerox/gasless/quote?buyToken=0x4200000000000000000000000000000000000006&chainId=8453&sellAmount=10000000&sellToken=0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913&taker=0x1111111111111111111111111111111111111111' \
-X GET \
-H "Authorization: Bearer $OPENANY_API_KEY" \
-H 'Content-Type: application/json'
```
## API contract
```json
{
"resource_type": "api",
"name": "Read-only DEX — 0x — Gasless firm quote — returns trade.eip712 (+ optional approval.eip712) for client to sign",
"endpoint": "https://api.openany.si/v1/agent-apis/blockrun/api/v1/zerox/gasless/quote",
"method": "GET",
"content_type": "none",
"execution_mode": "sync",
"authentication": {
"type": "bearer",
"environment_variable": "OPENANY_API_KEY"
},
"inputs": [
{
"description": "The contract address of the token to buy",
"location": "query",
"name": "buyToken",
"nullable": false,
"required": true,
"type": "string"
},
{
"description": "Chain ID. See [here](https://docs.0x.org/docs/introduction/supported-chains) for the list of supported chains",
"location": "query",
"name": "chainId",
"nullable": false,
"required": true,
"type": "integer"
},
{
"description": "Liquidity sources e.g. Uniswap_V3, SushiSwap, 0x_RFQ to exclude from the provided quote. See `https://api.0x.org/sources?chainId=<chain_id>` with the desired chain's ID for a full list of sources. Separate multiple sources with a comma",
"location": "query",
"name": "excludedSources",
"nullable": false,
"required": false,
"type": "string"
},
{
"description": "The address to receive the `buyToken`. If not provided, defaults to the taker address. Not supported for wrap/unwrap operations.",
"location": "query",
"name": "recipient",
"nullable": false,
"required": false,
"type": "string"
},
{
"description": "The amount of `sellToken` in `sellToken` base units to sell",
"location": "query",
"name": "sellAmount",
"nullable": false,
"required": true,
"type": "string"
},
{
"description": "The contract address of the token to sell. Native token is not supported",
"location": "query",
"name": "sellToken",
"nullable": false,
"required": true,
"type": "string"
},
{
"description": "The maximum acceptable slippage of the `buyToken` in Bps. 0x sets the optimal slippage tolerance per trade by default. To mitigate the risk of MEV attacks, we recommend adjusting this value only when trading low-liquidity tokens. Deprecated: use `slippagePpm` instead. `slippageBps` accepts only whole numbers.",
"location": "query",
"maximum": "10000",
"minimum": "30",
"name": "slippageBps",
"nullable": false,
"required": false,
"type": "integer"
},
{
"description": "The maximum acceptable slippage of the `buyToken` in parts-per-million (PPM). Mutually exclusive with `slippageBps`. e.g. 3000 PPM = 30 BPS = 0.30%.",
"location": "query",
"maximum": "1000000",
"minimum": "0",
"name": "slippagePpm",
"nullable": false,
"required": false,
"type": "integer"
},
{
"description": "The address which holds the `sellToken` balance and has the allowance set for the swap",
"location": "query",
"name": "taker",
"nullable": false,
"required": true,
"type": "string"
},
{
"description": "The maximum trade surplus (positive slippage) that can be collected in Bps of the buy amount. If not provided, defaults to 10000 (100%). Must be used together with `tradeSurplusRecipient`. Mutually exclusive with `tradeSurplusMaxPpm`.",
"location": "query",
"maximum": "10000",
"minimum": "1",
"name": "tradeSurplusMaxBps",
"nullable": false,
"required": false,
"type": "integer"
},
{
"description": "The maximum trade surplus (positive slippage) that can be collected in parts-per-million (PPM) of the buy amount. Mutually exclusive with `tradeSurplusMaxBps`. If not provided, defaults to 1000000 (100%). Must be used together with `tradeSurplusRecipient`. e.g. 5000 PPM = 50 BPS = 0.5%.",
"location": "query",
"maximum": "1000000",
"minimum": "1",
"name": "tradeSurplusMaxPpm",
"nullable": false,
"required": false,
"type": "integer"
},
{
"description": "The address to receive any trade surplus. If specified, this address will receive trade surplus when applicable. Otherwise, the taker will receive the surplus. This feature is only available to selected integrators on a custom pricing plan. In other cases, the surplus will be collected by 0x. For assistance with a custom plan, please contact support.",
"location": "query",
"name": "tradeSurplusRecipient",
"nullable": false,
"required": false,
"type": "string"
}
],
"billing": {
"currency": "USD",
"mode": "fixed",
"priceMicroUsd": "0",
"rounding": null,
"unit": "call",
"unitQuantity": null
},
"examples": [
{
"http_status": 200,
"name": "Documentation example",
"request": {
"body": null,
"headers": {},
"path": {},
"query": {
"buyToken": "0x4200000000000000000000000000000000000006",
"chainId": "8453",
"sellAmount": "10000000",
"sellToken": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"taker": "0x1111111111111111111111111111111111111111"
}
},
"response_body": {
"allowanceTarget": "0x000000000022d473030f116ddee9f6b43ac78ba3",
"approval": {
"eip712": {
"domain": {
"chainId": 8453,
"name": "USD Coin",
"verifyingContract": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"version": "2"
},
"message": {
"deadline": "1793535479",
"nonce": 0,
"owner": "0x1111111111111111111111111111111111111111",
"spender": "0x000000000022d473030f116ddee9f6b43ac78ba3",
"value": "115792089237316195423570985008687907853269984665640564039457584007913129639935"
},
"primaryType": "Permit",
"types": {
"EIP712Domain": [
{
"name": "name",
"type": "string"
},
{
"name": "version",
"type": "string"
},
{
"name": "chainId",
"type": "uint256"
},
{
"name": "verifyingContract",
"type": "address"
}
],
"Permit": [
{
"name": "owner",
"type": "address"
},
{
"name": "spender",
"type": "address"
},
{
"name": "value",
"type": "uint256"
},
{
"name": "nonce",
"type": "uint256"
},
{
"name": "deadline",
"type": "uint256"
}
]
}
},
"hash": "0x858cb13d3c27b785c46aba8c4aa1c93ee3a01198651eb41d3132c41760b9b7e3",
"type": "permit"
},
"blockNumber": "53329866",
"buyAmount": "4436068845652620",
"buyToken": "0x4200000000000000000000000000000000000006",
"fees": {
"gasFee": {
"amount": "7026",
"token": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"type": "gas"
},
"integratorFee": {
"amount": "20000",
"token": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"type": "volume"
},
"integratorFees": [
{
"amount": "20000",
"token": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"type": "volume"
}
],
"zeroExFee": {
"amount": "15000",
"token": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"type": "volume"
}
},
"issues": {
"allowance": {
"actual": "0",
"spender": "0x000000000022d473030f116ddee9f6b43ac78ba3"
},
"balance": null,
"invalidSourcesPassed": [],
"simulationIncomplete": false
},
"liquidityAvailable": true,
"minBuyAmount": "4422760639115662",
"route": {
"fills": [
{
"from": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"proportionBps": "10000",
"source": "LunarBase",
"to": "0x4200000000000000000000000000000000000006"
}
],
"tokens": [
{
"address": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"symbol": "USDC"
},
{
"address": "0x4200000000000000000000000000000000000006",
"symbol": "WETH"
}
]
},
"sellAmount": "10000000",
"sellToken": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"target": "0xca11bde05977b3631167028862be2a173976ca11",
"tokenMetadata": {
"buyToken": {
"buyTaxBps": "0",
"sellTaxBps": "0",
"transferTaxBps": "0"
},
"sellToken": {
"buyTaxBps": "0",
"sellTaxBps": "0",
"transferTaxBps": "0"
}
},
"trade": {
"eip712": {
"domain": {
"chainId": 8453,
"name": "Permit2",
"verifyingContract": "0x000000000022d473030f116ddee9f6b43ac78ba3"
},
"message": {
"deadline": "1793449379",
"nonce": "2241959297937691820908574931991871",
"permitted": {
"amount": "10000000",
"token": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"
},
"slippageAndActions": {
"actions": [
"0x0dfeb419000000000000000000000000f22785087a4d1105c4ceb009305fc164f4d3358e000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda0291300000000000000000000000000000000000000000000000000000000009896800000000000000000000000000000000000006e898131631616b1779bad70bd3f000000000000000000000000000000000000000000000000000000006ae5dda3",
"0x38c9c147000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda0291300000000000000000000000000000000000000000000000000000000000002bc000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000044a9059cbb0000000000000000000000009f6601854dee374b1bfaf6350ffd27a97309d431000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"0x38c9c147000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda0291300000000000000000000000000000000000000000000000000000000000007d0000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000044a9059cbb000000000000000000000000e9030014f5dae217d0a152f02a043567b16c1abf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"0x38c9c147000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda0291300000000000000000000000000000000000000000000000000000000000005dc000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000044a9059cbb0000000000000000000000009f6601854dee374b1bfaf6350ffd27a97309d431000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"0x38c9c147000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda0291300000000000000000000000000000000000000000000000000000000000f42400000000000000000000000000000efc4ec03a7c47d3a38a9be7ff1d52dd01b99000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000c425d2e751000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda029130000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f22785087a4d1105c4ceb009305fc164f4d3358e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e31a7b317c03c000000000000000000000000000000000000000000000000000000006ae5dda300000000000000000000000000000000000000000000000000000000",
"0x38c9c147000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee00000000000000000000000000000000000000000000000000000000000f42400000000000000000000000004200000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000024d0e30db0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"0x5f80abae000000000000000000000000f5c4f3dc02c3fb9279495a8fef7b0741da9561570000000000000000000000004200000000000000000000000000000000000006000000000000000000000000000000000000000000000000000fc2f3d6b9b1c100000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f4240"
],
"buyToken": "0x4200000000000000000000000000000000000006",
"minAmountOut": "4422760639115662",
"recipient": "0x1111111111111111111111111111111111111111"
},
"spender": "0xf22785087a4d1105c4ceb009305fc164f4d3358e"
},
"primaryType": "PermitWitnessTransferFrom",
"types": {
"EIP712Domain": [
{
"name": "name",
"type": "string"
},
{
"name": "chainId",
"type": "uint256"
},
{
"name": "verifyingContract",
"type": "address"
}
],
"PermitWitnessTransferFrom": [
{
"name": "permitted",
"type": "TokenPermissions"
},
{
"name": "spender",
"type": "address"
},
{
"name": "nonce",
"type": "uint256"
},
{
"name": "deadline",
"type": "uint256"
},
{
"name": "slippageAndActions",
"type": "SlippageAndActions"
}
],
"SlippageAndActions": [
{
"name": "recipient",
"type": "address"
},
{
"name": "buyToken",
"type": "address"
},
{
"name": "minAmountOut",
"type": "uint256"
},
{
"name": "actions",
"type": "bytes[]"
}
],
"TokenPermissions": [
{
"name": "token",
"type": "address"
},
{
"name": "amount",
"type": "uint256"
}
]
}
},
"hash": "0x2a478b4dda4ececd55c3cdf112c44d43201d6c3485412fb97ab03b7bcb0aabe2",
"type": "settler_metatransaction"
},
"zid": "0x141a47490f760eaf1c30d2a5"
}
}
]
}
```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
Documentation example
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 12
Review these request fields before running. Keep the published provider and request method unchanged.
buyToken- The contract address of the token to buy
chainId- Chain ID. See [here](https://docs.0x.org/docs/introduction/supported-chains) for the list of supported chains
excludedSources- Liquidity sources e.g. Uniswap_V3, SushiSwap, 0x_RFQ to exclude from the provided quote. See `https://api.0x.org/sources?chainId=<chain_id>` with the desired chain's ID for a full list of sources. Separate multiple sources with a comma
recipient- The address to receive the `buyToken`. If not provided, defaults to the taker address. Not supported for wrap/unwrap operations.
sellAmount- The amount of `sellToken` in `sellToken` base units to sell
sellToken- The contract address of the token to sell. Native token is not supported
slippageBps- The maximum acceptable slippage of the `buyToken` in Bps. 0x sets the optimal slippage tolerance per trade by default. To mitigate the risk of MEV attacks, we recommend adjusting this value only when trading low-liquidity tokens. Deprecated: use `slippagePpm` instead. `slippageBps` accepts only whole numbers.
slippagePpm- The maximum acceptable slippage of the `buyToken` in parts-per-million (PPM). Mutually exclusive with `slippageBps`. e.g. 3000 PPM = 30 BPS = 0.30%.
taker- The address which holds the `sellToken` balance and has the allowance set for the swap
tradeSurplusMaxBps- The maximum trade surplus (positive slippage) that can be collected in Bps of the buy amount. If not provided, defaults to 10000 (100%). Must be used together with `tradeSurplusRecipient`. Mutually exclusive with `tradeSurplusMaxPpm`.
tradeSurplusMaxPpm- The maximum trade surplus (positive slippage) that can be collected in parts-per-million (PPM) of the buy amount. Mutually exclusive with `tradeSurplusMaxBps`. If not provided, defaults to 1000000 (100%). Must be used together with `tradeSurplusRecipient`. e.g. 5000 PPM = 50 BPS = 0.5%.
tradeSurplusRecipient- The address to receive any trade surplus. If specified, this address will receive trade surplus when applicable. Otherwise, the taker will receive the surplus. This feature is only available to selected integrators on a custom pricing plan. In other cases, the surplus will be collected by 0x. For assistance with a custom plan, please contact support.
Terminal · cURLcurl \ 'https://api.openany.si/v1/agent-apis/blockrun/api/v1/zerox/gasless/quote?buyToken=0x4200000000000000000000000000000000000006&chainId=8453&sellAmount=10000000&sellToken=0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913&taker=0x1111111111111111111111111111111111111111' \ -X GET \ -H "Authorization: Bearer $OPENANY_API_KEY" \ -H 'Content-Type: application/json'Check the response
Sample response · Documented HTTP 200
Sample response{ "allowanceTarget": "0x000000000022d473030f116ddee9f6b43ac78ba3", "approval": { "eip712": { "domain": { "chainId": 8453, "name": "USD Coin", "verifyingContract": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", "version": "2" }, "message": { "deadline": "1793535479", "nonce": 0, "owner": "0x1111111111111111111111111111111111111111", "spender": "0x000000000022d473030f116ddee9f6b43ac78ba3", "value": "115792089237316195423570985008687907853269984665640564039457584007913129639935" }, "primaryType": "Permit", "types": { "EIP712Domain": [ { "name": "name", "type": "string" }, { "name": "version", "type": "string" }, { "name": "chainId", "type": "uint256" }, { "name": "verifyingContract", "type": "address" } ], "Permit": [ { "name": "owner", "type": "address" }, { "name": "spender", "type": "address" }, { "name": "value", "type": "uint256" }, { "name": "nonce", "type": "uint256" }, { "name": "deadline", "type": "uint256" } ] } }, "hash": "0x858cb13d3c27b785c46aba8c4aa1c93ee3a01198651eb41d3132c41760b9b7e3", "type": "permit" }, "blockNumber": "53329866", "buyAmount": "4436068845652620", "buyToken": "0x4200000000000000000000000000000000000006", "fees": { "gasFee": { "amount": "7026", "token": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", "type": "gas" }, "integratorFee": { "amount": "20000", "token": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", "type": "volume" }, "integratorFees": [ { "amount": "20000", "token": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", "type": "volume" } ], "zeroExFee": { "amount": "15000", "token": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", "type": "volume" } }, "issues": { "allowance": { "actual": "0", "spender": "0x000000000022d473030f116ddee9f6b43ac78ba3" }, "balance": null, "invalidSourcesPassed": [], "simulationIncomplete": false }, "liquidityAvailable": true, "minBuyAmount": "4422760639115662", "route": { "fills": [ { "from": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", "proportionBps": "10000", "source": "LunarBase", "to": "0x4200000000000000000000000000000000000006" } ], "tokens": [ { "address": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", "symbol": "USDC" }, { "address": "0x4200000000000000000000000000000000000006", "symbol": "WETH" } ] }, "sellAmount": "10000000", "sellToken": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", "target": "0xca11bde05977b3631167028862be2a173976ca11", "tokenMetadata": { "buyToken": { "buyTaxBps": "0", "sellTaxBps": "0", "transferTaxBps": "0" }, "sellToken": { "buyTaxBps": "0", "sellTaxBps": "0", "transferTaxBps": "0" } }, "trade": { "eip712": { "domain": { "chainId": 8453, "name": "Permit2", "verifyingContract": "0x000000000022d473030f116ddee9f6b43ac78ba3" }, "message": { "deadline": "1793449379", "nonce": "2241959297937691820908574931991871", "permitted": { "amount": "10000000", "token": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913" }, "slippageAndActions": { "actions": [ "0x0dfeb419000000000000000000000000f22785087a4d1105c4ceb009305fc164f4d3358e000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda0291300000000000000000000000000000000000000000000000000000000009896800000000000000000000000000000000000006e898131631616b1779bad70bd3f000000000000000000000000000000000000000000000000000000006ae5dda3", "0x38c9c147000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda0291300000000000000000000000000000000000000000000000000000000000002bc000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000044a9059cbb0000000000000000000000009f6601854dee374b1bfaf6350ffd27a97309d431000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "0x38c9c147000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda0291300000000000000000000000000000000000000000000000000000000000007d0000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000044a9059cbb000000000000000000000000e9030014f5dae217d0a152f02a043567b16c1abf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "0x38c9c147000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda0291300000000000000000000000000000000000000000000000000000000000005dc000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000044a9059cbb0000000000000000000000009f6601854dee374b1bfaf6350ffd27a97309d431000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "0x38c9c147000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda0291300000000000000000000000000000000000000000000000000000000000f42400000000000000000000000000000efc4ec03a7c47d3a38a9be7ff1d52dd01b99000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000c425d2e751000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda029130000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f22785087a4d1105c4ceb009305fc164f4d3358e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e31a7b317c03c000000000000000000000000000000000000000000000000000000006ae5dda300000000000000000000000000000000000000000000000000000000", "0x38c9c147000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee00000000000000000000000000000000000000000000000000000000000f42400000000000000000000000004200000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000024d0e30db0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "0x5f80abae000000000000000000000000f5c4f3dc02c3fb9279495a8fef7b0741da9561570000000000000000000000004200000000000000000000000000000000000006000000000000000000000000000000000000000000000000000fc2f3d6b9b1c100000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f4240" ], "buyToken": "0x4200000000000000000000000000000000000006", "minAmountOut": "4422760639115662", "recipient": "0x1111111111111111111111111111111111111111" }, "spender": "0xf22785087a4d1105c4ceb009305fc164f4d3358e" }, "primaryType": "PermitWitnessTransferFrom", "types": { "EIP712Domain": [ { "name": "name", "type": "string" }, { "name": "chainId", "type": "uint256" }, { "name": "verifyingContract", "type": "address" } ], "PermitWitnessTransferFrom": [ { "name": "permitted", "type": "TokenPermissions" }, { "name": "spender", "type": "address" }, { "name": "nonce", "type": "uint256" }, { "name": "deadline", "type": "uint256" }, { "name": "slippageAndActions", "type": "SlippageAndActions" } ], "SlippageAndActions": [ { "name": "recipient", "type": "address" }, { "name": "buyToken", "type": "address" }, { "name": "minAmountOut", "type": "uint256" }, { "name": "actions", "type": "bytes[]" } ], "TokenPermissions": [ { "name": "token", "type": "address" }, { "name": "amount", "type": "uint256" } ] } }, "hash": "0x2a478b4dda4ececd55c3cdf112c44d43201d6c3485412fb97ab03b7bcb0aabe2", "type": "settler_metatransaction" }, "zid": "0x141a47490f760eaf1c30d2a5" }