# Transaction Preflight Simulator (txpreflight)

> Transaction Preflight Simulator (txpreflight) is a paid API for AI agents from api.firstmention.uk, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-29).

Simulates an EVM transaction on Base mainnet before sending, returning gas estimates, revert checks, fee quotes, and a safe-to-send verdict.

## Facts

- Endpoint: POST https://api.firstmention.uk/s/txpreflight/preflight?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-29
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/transaction-preflight-simulator-txpreflight-a239281d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_cz4xmlQ5ED2VgRZHbQ5Sk

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 transaction-preflight-simulator-txpreflight-a239281d -d '<json body>'
```

Example prompt: Before I send my contract call to 0xAbC...123 on Base with this calldata 0xdeadbeef and value 0 wei, can you do a preflight simulation using normal fee urgency to check if it'll revert and what the gas cost will be in USD?

## When to prefer this

Use this endpoint when you need a real-time, pay-per-call preflight simulation of any EVM transaction on Base mainnet — particularly when you want gas estimates, revert prediction, fee tier quotes (slow/normal/fast), and a safe-to-send verdict in a single call. Prefer this over generic gas APIs when you need actual calldata simulation (not just transfer estimates) and USD-denominated cost breakdowns against a live ETH price. It is paid per-call in USDC via x402, making it suitable for agent workflows where cost-per-query matters.

## Known failure modes

- Invalid or malformed 0x address for 'to' field returns error
- Malformed calldata hex causes parsing failure
- Transaction simulation shows revert with revertReason populated and wouldRevert: true
- Network or RPC node unavailability causes 5xx error
- Stale block data if the Base node lags behind head
- Payment not accepted (x402) if USDC balance insufficient

## How this service works

Pay-per-call HTTP APIs, paid with x402 in USDC on Base (eip155:8453): agentkit, api-change-check, basedue, basewatch, chainread, check-sanctions, chgwatch, company-facts, composite, edgar, feednews, pageaudit, solcheck, token-dd, txpreflight, walletcheck, webmd, webread, websearch, x402index. Each operation describes its service.

## Output

Returns a JSON object with ok status, chain info (Base, chainId 8453), current ETH/USD price, a detailed summary (gas estimate, base fee, max fee per gas, priority fee, expected and worst-case gas costs in ETH and USD), a human-readable simulation result, a verdict ('safe-to-send' or similar), any warnings, the block number used for simulation, latency, and a disclaimer that the simulation reflects the latest block only.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "to": {
   "type": "string"
  },
  "data": {
   "type": "string"
  },
  "from": {
   "type": "string"
  },
  "owner": {
   "type": "string"
  },
  "token": {
   "type": "string"
  },
  "spender": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "chain": "base",
  "ethUsd": 2341.57,
  "chainId": 8453,
  "summary": {
   "simulation": "call succeeds",
   "baseFeeGwei": 0.005,
   "gasEstimate": 51542,
   "wouldRevert": false,
   "revertReason": null,
   "gasUnitsToSend": 59274,
   "maxFeePerGasWei": "11000000",
   "priorityFeeGwei": 0.001,
   "expectedGasCostEth": 3.56e-7,
   "expectedGasCostUsd": 0.000833,
   "worstCaseGasCostUsd": 0.001527,
   "effectiveGasPriceWei": "6000000",
   "maxPriorityFeePerGasWei": "1000000"
  },
  "verdict": "safe-to-send",
  "warnings": [],
  "asOfBlock": 53042234,
  "latencyMs": 337,
  "disclaimer": "Simulation against the latest block only. It is not a guarantee."
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/transaction-preflight-simulator-txpreflight-a239281d/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.firstmention.uk](https://www.zero.xyz/host/api.firstmention.uk/llms.txt)
