# Token Swap Quote on Base (x402)

> Token Swap Quote on Base (x402) is a paid API for AI agents from x402helper.xyz, paid per call via x402, $0.065/call, status unknown (last checked 2026-11-28).

Returns a DEX swap quote for exchanging ERC-20 tokens on the Base network, including calldata for executing the swap on-chain.

## Facts

- Endpoint: GET https://x402helper.xyz/89e509/swap/quote?utm_source=zero.xyz
- Price: $0.065/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-28
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/token-swap-quote-on-base-x402-c9ed0d79
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_lksLpQa_-YqRkdVGdDYTN

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 token-swap-quote-on-base-x402-c9ed0d79
```

Example prompt: Get me a swap quote to sell 1000000000000000000 raw units of WETH for USDC on Base, sending the output to 0xAbC123...456, with 50 basis points max slippage.

## When to prefer this

Use this endpoint when you need a real-time DEX swap quote specifically on the Base network for ERC-20 tokens (including WETH, USDC, AERO, and arbitrary 0x addresses). It is ideal for AI agents that need to price or prepare on-chain swaps programmatically and are willing to pay a small USDC micropayment per call via the x402 protocol. Prefer this over centralized exchange price feeds when you need executable calldata, not just indicative prices.

## Known failure modes

- Unsupported token symbol or invalid ERC-20 address returns an error result
- amountIn of zero or non-integer string causes validation failure
- Invalid or non-checksummed recipient address rejected
- slippageBps exceeding 5000 (50%) rejected
- Payment of 0.065 USDC via x402 fails if agent wallet lacks funds
- Token pair with no liquidity returns no route found error
- Network congestion may cause stale or unavailable quotes

## How this service works

X402 micropayments server — AI agents pay USDC for OFAC screening, rates, and billing verification.

## Output

A JSON object with a 'success' boolean and a 'result' object containing the swap quote details — including expected output amount, exchange rate, calldata for executing the swap, and routing information for the Base network DEX aggregator.

## 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"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "tokenIn",
      "tokenOut",
      "amountIn",
      "recipient"
     ],
     "properties": {
      "tokenIn": {
       "type": "string",
       "default": null,
       "description": "Sell token: a supported symbol (WETH, USDC, AERO, ...) or a 0x ERC-20 address on Base."
      },
      "amountIn": {
       "type": "string",
       "default": null,
       "description": "Sell amount in RAW atomic units of tokenIn (e.g. 1 WETH = 1000000000000000000). Integer as string."
      },
      "tokenOut": {
       "type": "string",
       "default": null,
       "description": "Buy token: a supported symbol or a 0x ERC-20 address on Base."
      },
      "recipient": {
       "type": "string",
       "default": null,
       "description": "0x address that receives tokenOut (baked into the calldata)."
      },
      "slippageBps": {
       "type": "integer",
       "default": null,
       "description": "Max slippage in basis points (50 = 0.5%). Default 50, max 5000."
      },
      "deadlineSeconds": {
       "type": "integer",
       "default": null,
       "description": "Seconds from now until the swap deadline. Default 600."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "result": {},
  "success": true
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/token-swap-quote-on-base-x402-c9ed0d79/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402helper.xyz](https://www.zero.xyz/host/x402helper.xyz/llms.txt)
