Skip to main content
Glama

OpenAny

Read-only DEX — 0x — Indicative Permit2 swap quote (no commitment)

blockrun_get_api_v1_zerox_price

Indicative Permit2 swap quote (no commitment). Provider: 0x. Free to call — BlockRun earns the on-chain affiliate fee set on each quote, not an x402 charge. Uses the caller's OpenAny gateway credentials. Charges and authorization are determined by the gateway.

Input Schema

NameRequiredDescriptionDefault
takerNoThe address which holds the `sellToken` balance and has the allowance set for the swap
chainIdYesChain ID. See [here](https://docs.0x.org/docs/introduction/supported-chains) for the list of supported chains
buyTokenYesThe contract address of the token to buy
gasPriceNoThe target gas price (in wei) for the swap transaction. If not provided, the default value is based on the 0x gas price oracle
txOriginNoThe address of the external account that started the transaction. This is only needed if `taker` is a smart contract.
buyAmountNoThe amount of `buyToken` in `buyToken` base units to buy. Exactly one of `sellAmount` or `buyAmount` must be provided — specifying both will result in an error.
recipientNoThe address to receive the `buyToken`. If not provided, defaults to the taker address. Not supported for wrap/unwrap operations.
sellTokenYesThe contract address of the token to sell
sellAmountNoThe amount of `sellToken` in `sellToken` base units to sell. Exactly one of `sellAmount` or `buyAmount` must be provided — specifying both will result in an error.
slippageBpsNoThe maximum acceptable slippage of the `buyToken` in Bps. If this parameter is set to 0, no slippage will be tolerated. If not provided, the default slippage tolerance is 100Bps. Deprecated: use `slippagePpm` instead. `slippageBps` accepts only whole numbers.
slippagePpmNoThe maximum acceptable slippage of the `buyToken` in parts-per-million (PPM). Mutually exclusive with `slippageBps`. e.g. 3000 PPM = 30 BPS = 0.30%.
wrapUnwrapModeNoControls how native wrap/unwrap trades are executed. `direct` calls the wrapped-native token contract directly. `settler` routes wrap/unwrap through Settler or Allowance Holder for compatibility. Ignored for non-wrap/unwrap swaps. If omitted, `direct` mode is used.
excludedSourcesNoLiquidity 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
sellEntireBalanceNoIf set to `true`, the taker's entire `sellToken` balance will be sold during trade execution. The `sellAmount` should be the maximum estimated value, as close as possible to the actual taker's balance to ensure the best routing. Selling more than the `sellAmount` may cause the trade to revert. This feature is designed for cases where the precise sell amount is determined during execution. Learn more [here](https://docs.0x.org/docs/0x-swap-api/additional-topics/sell-entire-balance).
tradeSurplusMaxBpsNoThe 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`.
tradeSurplusMaxPpmNoThe 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%.
tradeSurplusRecipientNoThe 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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.