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.
0x Swap API questions: routing, gasless, chains, cost
- Does the 0x Swap API cost anything through BlockRun?
- No. Price, quote, submit and status are free for callers: this is the one service on the site with no payment header. The rate card on this page reads Free.
- What is a gasless swap on 0x?
- A swap where the 0x relayer pays gas: you sign an EIP-712 message for the trade (and optionally the approval) instead of broadcasting a transaction. It is the flow for an agent that holds the sell token but no gas.
- What is a Permit2 swap?
- The standard flow: get a firm quote, sign one EIP-712 Permit2 message, broadcast the returned transaction from a wallet that pays gas.
- Which chains does the 0x Swap API support?
- The chains endpoint on this page lists them at request time, and the gasless-tokens endpoint says which tokens are eligible for the gasless flow, so a client can fail fast before quoting.
- Does the 0x endpoint execute the swap for me?
- No. It prices and routes across many DEXes and returns a transaction or typed data to sign; your wallet signs and submits. Nothing here holds funds.
- 0x via BlockRun vs 1inch, Jupiter or Uniswap's routing API?
- Each needs its own key, with per-key rate limits and a paid tier on some. This is 0x's routing reached with no key and no limit, free for callers, returning the same transaction or typed data to sign.
- Can an AI trading agent rebalance a portfolio through 0x here?
- Yes. Quote, sign with the agent's wallet, submit — one quote, one signature, one transaction — with the gasless flow when the agent holds no gas token.
- How do I use the 0x Swap API without a 0x API key?
- Call BlockRun's swap endpoint. It proxies 0x's Swap and Gasless APIs as a public passthrough — BlockRun holds the upstream key, your agent sends no header, no auth and no payment.