# SpendPreflight

> SpendPreflight is a paid API for AI agents from api.spendpreflight.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-12).

Pre-authorizes AI agent payments by evaluating x402 PaymentRequired responses or carts against configurable spending rules, returning an allow/hold/block decision with the cheapest acceptable payment option and a receipt ID.

## Facts

- Endpoint: POST https://api.spendpreflight.com/v1/preflight?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/spendpreflight-3175847d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_eLTtphfw-hlATMQ9-Cto5

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 spendpreflight-3175847d -d '<json body>'
```

Example prompt: Before paying this x402 PaymentRequired response, check it against my rules: max $5 per payment, $50 daily cap, and block any domain I haven't seen for at least 7 days — tell me if it's safe to proceed and what the cheapest payment option is.

## When to prefer this

Use this endpoint before every AI agent payment to enforce spending guardrails without risking funds — it is read-only and never signs or settles transactions. Prefer it over manual rule checks when your agent handles x402 PaymentRequired responses or needs auditable receipts for every payment decision. It is especially valuable when running autonomous agents with real budgets, needing daily caps, per-payment limits, domain allowlisting, or hold-for-review workflows before committing USDC.

## Known failure modes

- Malformed or missing x402 PaymentRequired body returns a validation error
- Unsupported x402 version (not v1 or v2) may cause parsing failure
- Conflicting rules (e.g. per-payment max lower than minimum network fee) may always return block
- If the daily cap has already been reached, all payments will be blocked regardless of amount
- Domain age rules may block legitimate new merchants not yet on the allowlist

## How this service works

Operated by SpendPreflight: sanctions screening and allow/hold/block preflight for x402 payments.

## Output

A JSON object containing: a 'decision' field (allow, hold, or block), a 'reasons' array explaining the decision in plain language, the cheapest acceptable payment option from the provided x402 body, and a 'receipt' object with a unique ID, timestamp, decision, and SHA-256 hash of the input for audit purposes.

## 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",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "properties": {}
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "reasons": [
   "allow: all rules passed"
  ],
  "receipt": {
   "id": "…",
   "ts": "…",
   "decision": "allow",
   "input_sha256": "…"
  },
  "decision": "allow"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/spendpreflight-3175847d/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.spendpreflight.com](https://www.zero.xyz/host/api.spendpreflight.com/llms.txt)
