DEX TRADING · PARTNER
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.
Capabilities
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 gasAgent receives a rebalance instruction and converts USDC → WETH on Base. One quote, one signature, one tx.
quoteUSDC → WETH, sellAmount in base unitssignPermit2 EIP-712 with taker walletsubmitbroadcast tx — wallet pays gasGasless DCA Without ETH
zero ETH requiredAgent 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 approvalgasless/submitPOST signed trade — relayer pays gasgasless/statuspoll tradeHash until confirmedTake-Profit on a Position
single quotePosition 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 commitquotefirm quote when user confirmssubmitbroadcast txPre-flight Eligibility Check
freeBefore 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 allgasless/approval-tokenscan sellToken use Permit gasless flowPricing
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.
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.
| Endpoint | Method | Description |
|---|---|---|
/api/v1/zerox/price | GET | Indicative Permit2 swap quote (no commitment). |
/api/v1/zerox/quote | GET | Firm Permit2 swap quote with permit2.eip712 + tx data. |
/api/v1/zerox/gasless/price | GET | Gasless indicative price quote. |
/api/v1/zerox/gasless/quote | GET | Gasless firm quote — returns trade.eip712 (+ optional approval.eip712) for client to sign. |
/api/v1/zerox/gasless/submit | POST | Submit signed gasless trade (+ optional approval). 0x relayer pays gas; client gets a tradeHash to poll. |
/api/v1/zerox/gasless/status/{...} | GET | Poll status of a gasless trade by tradeHash. Path = /gasless/status/{tradeHash}. |
/api/v1/zerox/gasless/approval-tokens | GET | List 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/chains | GET | List chains where the Gasless API is supported. |
/api/v1/zerox/swap/chains | GET | List 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.