BlockRun
All Data Sources

DEX TRADING · PARTNER

0x Swap

DEX aggregation for AI agents — Permit2 + Gasless V2

BlockRun proxies the 0x V2 Swap and Gasless V2 APIs as a free public passthrough. No API key required from your agent, no x402 payment, no subscription — point your agent at the gateway and call any endpoint.

11 endpoints live
Free public passthrough

Capabilities

Permit2 Swap V2
Best-execution swap routing across 100+ DEXes via Permit2. Get a firm quote, sign one EIP-712, broadcast — your wallet pays gas.
Gasless V2
Sign trade.eip712 (and an optional approval.eip712) and the 0x relayer pays gas. Ideal for agents that hold the sell token but no ETH.
No API Keys
BlockRun holds the upstream 0x key server-side. Your agent calls the endpoint directly — no header, no auth, no rate-limit account.
Capability Discovery
Helper endpoints list supported chains and gasless-eligible tokens, so your client can fail fast before quoting.

What AI Agents Use It For

Any agent that needs to convert one token to another — rebalance a portfolio, take profit, top up gas, settle revenue. Standard Swap V2 when the agent has gas; Gasless V2 when it doesn't.

Agent Rebalances to a Target Allocation

wallet pays gas

Agent receives a rebalance instruction and converts USDC → WETH on Base. One quote, one signature, one tx.

quoteUSDC → WETH, sellAmount in base units
signPermit2 EIP-712 with taker wallet
submitbroadcast tx — wallet pays gas

Gasless DCA Without ETH

zero ETH required

Agent dollar-cost-averages into ETH from a USDC balance, but holds no ETH for gas. Use Gasless V2 — sign trade + approval EIP-712s, BlockRun forwards to 0x's relayer, the relayer pays gas.

gasless/quotereturns trade.eip712 + optional approval
gasless/submitPOST signed trade — relayer pays gas
gasless/statuspoll tradeHash until confirmed

Take-Profit on a Position

single quote

Position breaches a take-profit threshold. Agent quotes the inverse pair, signs Permit2, broadcasts. No subscription, no per-month minimum, no key rotation.

priceindicative — surface to UI before commit
quotefirm quote when user confirms
submitbroadcast tx

Pre-flight Eligibility Check

free

Before quoting on a chain you haven't routed before, probe the helper endpoints. Both chain lists and the gasless-approval-tokens list are free passthrough GETs.

swap/chainsis this chain supported at all
gasless/approval-tokenscan sellToken use Permit gasless flow

Pricing

BlockRun does not charge the caller. Free public passthrough — no API keys, no x402 payment, no subscription. Implementation details for integrators are in the API reference.

caller pays BlockRun
$0
free public passthrough

API Reference

Base URL: https://blockrun.ai/api/v1/zerox/

All endpoints are direct passthroughs to api.0x.org. No Authorization or 0x-api-key header is needed from the caller. Request and response shapes match the upstream 0x V2 spec verbatim.

EndpointMethodDescription
/api/v1/zerox/priceGETIndicative Permit2 swap quote (no commitment).
/api/v1/zerox/quoteGETFirm Permit2 swap quote with permit2.eip712 + tx data.
/api/v1/zerox/gasless/priceGETGasless indicative price quote.
/api/v1/zerox/gasless/quoteGETGasless firm quote — returns trade.eip712 (+ optional approval.eip712) for client to sign.
/api/v1/zerox/gasless/submitPOSTSubmit signed gasless trade (+ optional approval). 0x relayer pays gas; client gets a tradeHash to poll.
/api/v1/zerox/gasless/status/{...}GETPoll status of a gasless trade by tradeHash. Path = /gasless/status/{tradeHash}.
/api/v1/zerox/gasless/approval-tokensGETList tokens that support gasless approval (Permit) on a given chain. Use to check if a sell-token can use the fully-gasless flow before quoting.
/api/v1/zerox/gasless/chainsGETList chains where the Gasless API is supported.
/api/v1/zerox/swap/chainsGETList chains where the Swap API is supported.

Quick Start

Permit2 quote on Base — 10 USDC → WETH:

# Indicative price (no commitment, no signature needed)
curl "https://blockrun.ai/api/v1/zerox/price?\
chainId=8453&\
sellToken=0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913&\
buyToken=0x4200000000000000000000000000000000000006&\
sellAmount=10000000&\
taker=0xYourAgentWallet"

# Firm quote — same params, returns permit2.eip712 + tx data
curl "https://blockrun.ai/api/v1/zerox/quote?\
chainId=8453&\
sellToken=0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913&\
buyToken=0x4200000000000000000000000000000000000006&\
sellAmount=10000000&\
taker=0xYourAgentWallet"

# Gasless flow — agent has no ETH for gas
curl "https://blockrun.ai/api/v1/zerox/gasless/quote?\
chainId=8453&\
sellToken=0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913&\
buyToken=0x4200000000000000000000000000000000000006&\
sellAmount=10000000&\
taker=0xYourAgentWallet"
# → sign trade.eip712 (+ optional approval.eip712), POST to /gasless/submit,
#   poll /gasless/status/{tradeHash}

Full request/response shapes: 0x Swap (DEX) — API Reference.

Start swapping with 0x

Point your agent at https://blockrun.ai/api/v1/zerox/ and call any endpoint. No registration, no API keys, no SDK install.