# SafeRoute Transaction Preflight

> SafeRoute Transaction Preflight is a paid API for AI agents from api.usesaferoute.com, paid per call via x402, $0.05/call, status unknown (last checked 2026-11-20).

Validates and diagnoses an Ethereum/Base blockchain transaction before submission, checking for safety issues and payment flow problems.

## Facts

- Endpoint: POST https://api.usesaferoute.com/v1/transaction-preflight?utm_source=zero.xyz
- Price: $0.05/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-20
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/saferoute-transaction-preflight-07fab590
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_js4er6IDzplkT5UfyL5k3

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 saferoute-transaction-preflight-07fab590 -d '<json body>'
```

Example prompt: Before I submit this Base chain transaction from 0xAbCd...1234 to 0x5678...EfAb with calldata 0xdeadbeef, can you run a SafeRoute preflight check to make sure it's safe and won't fail?

## When to prefer this

Use this endpoint when you need to validate a Base or Ethereum transaction before signing or broadcasting — especially for x402 payment flows, DeFi interactions, or any agent-initiated on-chain action where silent failure would be costly. Prefer this over generic RPC simulation when you also need structured diagnostics and a safety audit report.

## Known failure modes

- Invalid Ethereum address format for 'from' or 'to' fields returns a validation error
- Malformed hex calldata in 'data' field causes rejection
- intentId too short (under 16 chars) or containing invalid characters fails schema validation
- Network or RPC errors when simulating the transaction may cause timeouts
- Transaction simulation failure indicating the on-chain call would revert

## How this service works

Workflow automation, Stripe and API integration repair, and x402 payment diagnostics. Choose a fixed scope and review it before payment.

## Output

Returns a JSON object with a status field (e.g. 'ok') and a service identifier confirming the preflight completed, along with any diagnostic findings about the transaction's safety or potential failure modes.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "intentId": {
   "type": "string",
   "pattern": "^[a-zA-Z0-9_-]+$",
   "maxLength": 128,
   "minLength": 16
  },
  "transaction": {
   "type": "object",
   "required": [
    "from",
    "to",
    "data"
   ],
   "properties": {
    "to": {
     "type": "string",
     "pattern": "^0x[a-fA-F0-9]{40}$"
    },
    "data": {
     "type": "string",
     "pattern": "^0x[a-fA-F0-9]*$"
    },
    "from": {
     "type": "string",
     "pattern": "^0x[a-fA-F0-9]{40}$"
    },
    "value": {
     "type": "string",
     "default": "0",
     "pattern": "^\\d+$"
    }
   },
   "additionalProperties": false
  },
  "referralCode": {
   "type": "string",
   "pattern": "^[a-zA-Z0-9_-]+$",
   "maxLength": 64,
   "minLength": 3
  },
  "sourceAgentId": {
   "type": "string",
   "maxLength": 128,
   "minLength": 1
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "status": "ok",
  "service": "safe_transaction_preflight"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/saferoute-transaction-preflight-07fab590/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.usesaferoute.com](https://www.zero.xyz/host/api.usesaferoute.com/llms.txt)
