# dexswap-quote

> dexswap-quote is a paid API for AI agents from api.agentstools.dev, paid per call via x402, $0.05/call, status unknown (last checked 2026-10-10).

Returns optimized DEX swap calldata on Base by comparing Aerodrome and Uniswap V3 routes and picking the best output, ready for the user to sign

## Facts

- Endpoint: GET https://api.agentstools.dev/swap/quote?utm_source=zero.xyz
- Price: $0.05/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-10
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/dexswap-quote-d43dbf26
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_m0ltlF24tm5lKsZrXcggw

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability dexswap-quote-d43dbf26
```

Example prompt: Get me a swap quote to sell 1000 USDC (that's 1000000000 raw units) for WETH on Base, sending the output to 0xAbc123...def, with 50 bps slippage — I want to see the best route between Aerodrome and Uniswap V3 and the ready-to-sign calldata.

## When to prefer this

Choose this endpoint when you need non-custodial DEX swap calldata specifically on Base mainnet, want automatic route comparison between Aerodrome and Uniswap V3, and need the full transaction ready to sign with your own wallet — without giving any third party custody of funds. Prefer this over generic swap APIs when you need Base-native DEX routing, price impact visibility, and built-in ERC-20 approval generation in a single call.

## Known failure modes

- Unsupported token symbol or invalid ERC-20 address returns an error — use a supported symbol or a valid 0x Base address
- amountIn must be a non-zero integer string in raw atomic units; human-readable decimals will fail
- Recipient must be a valid 0x Ethereum address
- slippageBps exceeding 5000 is rejected
- Insufficient on-chain liquidity for the token pair may return no viable route
- Network or RPC issues reading Aerodrome or Uniswap V3 on-chain state may cause transient failures

## How this service works

Non-custodial swap calldata for Base: give tokenIn, tokenOut, raw amountIn, slippage and recipient; we read Aerodrome and Uniswap V3 on-chain state, pick the max-output route, and return ready-to-sign transaction calldata plus the ERC-20 approval, amountOutMin, price impact and the venues compared. You sign with your own wallet — we never hold or move funds.

## Output

Returns ready-to-sign EVM transaction calldata for the optimal swap route, the required ERC-20 approval payload, the minimum output amount (amountOutMin), estimated price impact percentage, and a breakdown of the venues (Aerodrome, Uniswap V3) that were compared with their respective output quotes.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "tokenIn",
      "tokenOut",
      "amountIn",
      "recipient"
     ],
     "properties": {
      "tokenIn": {
       "type": "string",
       "description": "Sell token: a supported symbol (WETH, USDC, AERO, ...) or a 0x ERC-20 address on Base."
      },
      "amountIn": {
       "type": "string",
       "description": "Sell amount in RAW atomic units of tokenIn (e.g. 1 WETH = 1000000000000000000). Integer as string."
      },
      "tokenOut": {
       "type": "string",
       "description": "Buy token: a supported symbol or a 0x ERC-20 address on Base."
      },
      "recipient": {
       "type": "string",
       "description": "0x address that receives tokenOut (baked into the calldata)."
      },
      "slippageBps": {
       "type": "integer",
       "description": "Max slippage in basis points (50 = 0.5%). Default 50, max 5000."
      },
      "deadlineSeconds": {
       "type": "integer",
       "description": "Seconds from now until the swap deadline. Default 600."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/dexswap-quote-d43dbf26/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.agentstools.dev](https://www.zero.xyz/host/api.agentstools.dev/llms.txt)
