# Treasury Preflight

> Treasury Preflight is a paid API for AI agents from preflight.admapu.xyz, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-20).

Returns per-chain gas fees, timing advice, and cost estimates for USDC/USDT stablecoin transfers before executing them.

## Facts

- Endpoint: GET https://preflight.admapu.xyz/v1/route?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-20
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/treasury-preflight-74d8ea5f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Pik4LZVtfKuReYD3hfTj0

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 treasury-preflight-74d8ea5f
```

Example prompt: Before I send $2500 in USDC, can you check which chain — Base, Arbitrum, Optimism, or Polygon — has the lowest fees right now and whether I should send immediately?

## When to prefer this

Use this endpoint when you need real-time, multi-chain fee comparison for USDC or USDT transfers before committing to a transaction — especially when optimizing for cost or timing across Base, Arbitrum, Optimism, Polygon, or Ethereum. Prefer this over static fee tables or wallet estimates when you need current gas prices, timing advice, and a direct cheapest-chain recommendation in one call.

## Known failure modes

- Unsupported token enum value returns validation error
- Invalid or missing 'token' query parameter causes 400-level error
- Unrecognized chain name in comma-separated list may be silently ignored or cause error
- Response validity window is short (~12 seconds) — stale if not acted on immediately
- Network congestion or RPC issues may delay or fail gas sampling
- Payment failure via x402 protocol will block the request

## How this service works

x402-paid preflight checks for stablecoin transfers.

## Output

A JSON object listing each requested chain as a route option, each with current block number, fee in basis points and USD, gas units, gas price in gwei, native token fee, timing advice (e.g. 'send_now'), a 24h percentile ranking, and a validity window. Also includes a top-level 'cheapest' field summarizing the best chain, its fee in USD, and timing recommendation.

## 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": [
      "token"
     ],
     "properties": {
      "token": {
       "enum": [
        "USDC",
        "USDT"
       ],
       "type": "string"
      },
      "amount": {
       "type": "string",
       "description": "Transfer size in USD, used for fee in basis points"
      },
      "chains": {
       "type": "string",
       "description": "Comma list from ethereum, base, arbitrum, optimism, polygon"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "token": "USDC",
  "amount": 2500,
  "options": [
   {
    "block": 36123456,
    "chain": "base",
    "token": "USDC",
    "feeBps": 0.0084,
    "feeUsd": 0.0021,
    "timing": {
     "advice": "send_now",
     "percentile24h": 41
    },
    "gasUnits": 45012,
    "feeNative": "0.000000812",
    "observedAt": "2026-09-30T14:00:00.000Z",
    "validUntil": "2026-09-30T14:00:12.000Z",
    "l1FeeNative": "0.000000281",
    "gasPriceGwei": 0.0118,
    "nativeSymbol": "ETH",
    "gasSampleSize": 17
   }
  ],
  "cheapest": {
   "chain": "base",
   "feeUsd": 0.0021,
   "timing": "send_now"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/treasury-preflight-74d8ea5f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from preflight.admapu.xyz](https://www.zero.xyz/host/preflight.admapu.xyz/llms.txt)
