# dexswap-price

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

Returns a lightweight DEX swap price quote on Base, comparing Aerodrome and Uniswap V3 routes to find the best output for a given token pair and amount.

## Facts

- Endpoint: GET https://api.agentstools.dev/swap/price
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/dexswap-price-b8c9e8af
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_AtOdGVrUKqF-DzKUAIJpX

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-price-b8c9e8af
```

Example prompt: Before I swap, can you check how much USDC I'd get for selling 1 WETH (1000000000000000000 raw units) on Base, comparing Aerodrome and Uniswap V3, with a max slippage of 50 basis points?

## When to prefer this

Use this endpoint when you need a fast, cheap price check on Base before constructing a full swap transaction — it avoids the overhead of calldata generation. Ideal for bots or agents that want to pre-screen price impact, compare Aerodrome vs Uniswap V3, or determine amountOutMin before committing to a trade. Not suitable if you need executable calldata (use dexswap-build for that) or if you're trading on chains other than Base.

## Known failure modes

- Unsupported token symbol or invalid ERC-20 address returns an error
- amountIn of zero or non-integer string causes validation failure
- Token pair with no liquidity on either venue returns no route found
- slippageBps exceeding 5000 is rejected
- Network issues or RPC failures may return a 5xx error
- Payment of $0.01 USDC not provided or rejected results in 402 Payment Required

## How this service works

Lightweight swap quote for Base without calldata: give tokenIn, tokenOut and raw amountIn and get the max-output route across Aerodrome and Uniswap V3, the buy amount, amountOutMin, price impact and the venues compared. A cheap price check before you build the full transaction.

## Output

Returns the optimal swap route (Aerodrome or Uniswap V3), the expected buy amount in raw units, the minimum output after slippage (amountOutMin), the price impact percentage, and a comparison of all venues evaluated — without building calldata.

## 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"
     ],
     "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."
      },
      "slippageBps": {
       "type": "integer",
       "description": "Max slippage in basis points (50 = 0.5%). Default 50, max 5000."
      }
     }
    }
   },
   "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-price-b8c9e8af/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)
