# 3Route Token Swap Quote API

> 3Route Token Swap Quote API is a paid API for AI agents from api.3route.io, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-19).

Returns a best-priced swap quote for exchanging one crypto token for another on a specified chain, including output amount and estimated gas.

## Facts

- Endpoint: GET https://api.3route.io/v1/pro/%7BchainId%7D/quote
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-19
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/3route-token-swap-quote-api-5d62e082
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Q24uvcJ62kCkNEPeHWGBT

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 3route-token-swap-quote-api-5d62e082
```

Example prompt: What's the best swap quote to trade 1 ETH (1000000000000000000 wei) for USDC (0x5fc5360d0400a0fd4f2af552add042d716f1d168) on chain 4663? Use the native asset as the source token.

## When to prefer this

Choose this endpoint when you need a pay-per-call, no-subscription DEX aggregator quote on chain 4663 without requiring an API key. Ideal for agents and bots that need on-demand, best-priced swap quotes with no recurring commitment. Prefer this over centralized exchange APIs when operating in a DeFi/on-chain context, and over subscription-based aggregators when call volume is unpredictable or low.

## Known failure modes

- Invalid or unsupported chain ID returns an error response
- Malformed token address (not matching 0x hex pattern) causes a 400-level error
- Amount of zero or non-integer amount string is rejected
- Unsupported token pair with no available liquidity route returns no quote or error
- Payment not completed via x402/MPP protocol results in 402 Payment Required
- Network timeout or upstream DEX provider unavailability causes request failure

## How this service works

Best-priced crypto token swaps for agents, traders and apps. Pay-per-call quote & swap API via x402/MPP. No API key or subscription.

## Output

Returns a JSON object containing the estimated destination token amount (dstAmount), the source amount (srcAmount), and the estimated gas cost for the swap. Optionally includes protocol routing details, token info, and block number if requested.

## 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"
    },
    "pathParams": {
     "type": "object",
     "required": [
      "chainId"
     ],
     "properties": {
      "chainId": {
       "enum": [
        "4663"
       ],
       "type": "string",
       "example": "4663",
       "pattern": "^[0-9]+$",
       "description": "Chain ID for the operation."
      }
     },
     "additionalProperties": false
    },
    "queryParams": {
     "type": "object",
     "required": [
      "src",
      "dst"
     ],
     "properties": {
      "dst": {
       "type": "string",
       "example": "0x5fc5360d0400a0fd4f2af552add042d716f1d168",
       "pattern": "^0x[0-9a-fA-F]{40}$",
       "description": "Address of the token being bought; take one from the token-list operation for the selected chain, or use the zero address, or the case-insensitive sentinel 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee, for the chain's native asset."
      },
      "fee": {
       "type": "number",
       "default": 0,
       "maximum": 3,
       "minimum": 0
      },
      "src": {
       "type": "string",
       "example": "0x0000000000000000000000000000000000000000",
       "pattern": "^0x[0-9a-fA-F]{40}$",
       "description": "Address of the token being sold; use the zero address, or the case-insensitive sentinel 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee, for the chain's native asset"
      },
      "amount": {
       "type": "string",
       "example": "1000000000000000000",
       "pattern": "^[0-9]+$",
       "description": "Single amount in smallest units. Cannot be combined with amounts; one of the two is required."
      },
      "amounts": {
       "type": "string",
       "pattern": "^[0-9]+(,[0-9]+)*$",
       "description": "Comma-separated amounts in smallest units. Cannot be combined with amount; one of the two is required."
      },
      "gasPrice": {
       "type": "string",
       "example": "1000000000",
       "pattern": "^[0-9]+$"
      },
      "protocols": {
       "type": "string"
      },
      "timestamp": {
       "type": "integer",
       "minimum": 0
      },
      "blockNumber": {
       "type": "integer",
       "minimum": 0
      },
      "is
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "gas": 210000,
  "dstAmount": "950000",
  "srcAmount": "1000000000000000000"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/3route-token-swap-quote-api-5d62e082/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.3route.io](https://www.zero.xyz/host/api.3route.io/llms.txt)
