# Treasury Preflight

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

Performs preflight validation checks on a stablecoin transfer to assess feasibility, gas costs, and risks before execution

## Facts

- Endpoint: GET https://preflight.admapu.xyz/v1/preflight?utm_source=zero.xyz
- Price: $0.03/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-fd7af14b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap__47rfW8Sp8m3tBmAFBa86

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-fd7af14b
```

Example prompt: Before I send 2500 USDC from 0xAbC...123 to 0xDeF...456 on Ethereum, run a preflight check to make sure the transfer will go through — look at my balance, gas coverage, and simulate the transaction.

## When to prefer this

Use this endpoint when you need to gate a stablecoin transfer with a safety check before execution — especially for automated agents, treasury operations, or high-value transfers where a failed on-chain transaction would be costly. Prefer this over manual balance checks when you need a combined assessment of token balance, gas adequacy, and transaction simulation in a single call. Best suited for Ethereum, Base, Arbitrum, Optimism, and Polygon with USDC or USDT.

## Known failure modes

- Missing required query parameters (token, from, to, amount) returns a 400 error
- Invalid Ethereum address format for 'from' or 'to' causes validation rejection
- Unsupported token or chain enum value results in an error
- RPC or on-chain simulation failure may return an error or degraded check results
- Payment of $0.03 USDC via x402 protocol required; missing or invalid payment returns 402
- Result may be stale if used after validUntil timestamp

## How this service works

x402-paid preflight checks for stablecoin transfers.

## Output

Returns a structured verdict ('pass', 'warn', or 'fail') along with an array of individual check results (e.g. token balance, gas coverage, transaction simulation), an estimated gas fee with USD and native token amounts, the block number at time of check, the chain and token details, and a validUntil timestamp indicating how long the result is fresh.

## 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",
      "from",
      "to",
      "amount"
     ],
     "properties": {
      "to": {
       "type": "string",
       "pattern": "^0x[a-fA-F0-9]{40}$",
       "description": "Recipient address"
      },
      "from": {
       "type": "string",
       "pattern": "^0x[a-fA-F0-9]{40}$",
       "description": "Sender address"
      },
      "chain": {
       "enum": [
        "ethereum",
        "base",
        "arbitrum",
        "optimism",
        "polygon"
       ],
       "type": "string",
       "default": "ethereum"
      },
      "token": {
       "enum": [
        "USDC",
        "USDT"
       ],
       "type": "string"
      },
      "amount": {
       "type": "string",
       "pattern": "^\\d+(\\.\\d{1,6})?$",
       "description": "Amount in token units, e.g. 2500.50"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "verdict",
      "fee",
      "checks",
      "block"
     ],
     "properties": {
      "fee": {
       "type": "object"
      },
      "block": {
       "type": "integer"
      },
      "checks": {
       "type": "array",
       "items": {
        "type": "object",
        "properties": {
         "id": {
          "type": "string"
         },
         "level": {
          "type": "string"
         },
         "detail": {
          "type": "string"
         }
        }
       }
      },
      "verdict": {
       "enum": [
        "pass",
        "warn",
        "fail"
       ],
       "type": "string"
      },
      "validUntil": {
       "type": "string"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "fee": {
   "usd": 0.42,
   "native": "0.000161",
   "timing": {
    "advice": "send_now",
    "percentile24h": 38
   },
   "gasUnits": 43210,
   "nativeSymbol": "ETH"
  },
  "block": 23456789,
  "chain": "ethereum",
  "token": "USDC",
  "amount": "2500",
  "checks": [
   {
    "id": "token_balance",
    "level": "pass",
    "detail": "Balance 10000.0 USDC covers the transfer."
   },
   {
    "id": "low_gas",
    "level": "warn",
    "detail": "Sender has 0.0004 ETH, under 3x the estimated fee."
   },
   {
    "id": "simulation",
    "level": "pass",
    "detail": "Transfer simulates successfully (43,210 gas)."
   }
  ],
  "verdict": "warn",
  "validUntil": "2026-09-30T14:00:24.000Z"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/treasury-preflight-fd7af14b/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)
