# Agent Buyer Identity Preflight | x402 Purchase Governance (Indexed Chain Query)

> Agent Buyer Identity Preflight | x402 Purchase Governance (Indexed Chain Query) is a paid API for AI agents from base-agent-preflight.bytoken2023.workers.dev, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-14).

Verifies whether an AI agent's buyer identity is authorized to purchase an indexed blockchain data query, checking role fit, price limits, sensitivity, and approval policy before the x402 payment is made.

## Facts

- Endpoint: GET https://base-agent-preflight.bytoken2023.workers.dev/v1/x402/chain/indexed-query-preflight
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent-buyer-identity-preflight-x402-purchase-governance-indexed-chain-b7483428
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_3ese0MaSPnBiFxqaDiWpy

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 agent-buyer-identity-preflight-x402-purchase-governance-indexed-chain-b7483428
```

Example prompt: Before buying that indexed balances query on Base (eip155:8453) via x402, run a preflight check to make sure my agent is authorized — the query type is 'balances', I'm estimating about 500 rows, and my max price is 0.10 USDC.

## When to prefer this

Use this endpoint when an AI agent is about to make an x402 micropayment for an indexed blockchain data query and you need to perform governance checks — verifying buyer role fitness, price acceptability, data sensitivity, and policy approval — before committing funds. Prefer this over generic identity checks when the purchase specifically involves indexed chain data (balances, transfers, event logs, transactions, SQL, schema, or protocol_timeline) on a supported EVM-compatible network. It is particularly valuable in automated agent pipelines where purchases must be pre-screened to prevent unauthorized or policy-violating spend.

## Known failure modes

- Missing required query parameters (chain, query_type) returns a 400 validation error
- Chain identifier not matching expected CAIP-2 pattern returns a pattern validation error
- Unknown or unsupported query_type enum value returns a schema error
- Buyer identity not resolvable or flagged returns a high risk_level with populated flags array
- Downstream governance policy service unavailable returns a 502 or timeout
- Price ceiling exceeded by the assessed query cost may produce a risk flag

## How this service works

Machine-payable service intelligence for discovering, verifying, and monitoring identity, risk, authorization, execution-preflight, and evidence APIs before autonomous agents spend.

## Output

A JSON object containing the network identifier (e.g. 'eip155:8453'), product name, buyer identity details, activity profile, provenance record, and a risk assessment with a numeric risk score (0–1), a risk level label (e.g. 'low'), and any raised flags. A low risk score with empty flags indicates the agent buyer is cleared to proceed with the x402 purchase.

## 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": [
      "chain",
      "query_type"
     ],
     "properties": {
      "chain": {
       "type": "string",
       "pattern": "^[A-Za-z0-9:_ -]{2,80}$",
       "description": "Requested chain or CAIP-2 network label."
      },
      "query_type": {
       "enum": [
        "schema",
        "event_logs",
        "transfers",
        "balances",
        "transactions",
        "sql",
        "protocol_timeline"
       ],
       "type": "string",
       "description": "Indexed data query family."
      },
      "estimated_rows": {
       "type": "string",
       "pattern": "^[0-9]{1,10}$",
       "description": "Caller-estimated row count or result size."
      },
      "max_price_usdc": {
       "type": "string",
       "pattern": "^[0-9]+(?:\\.[0-9]{1,6})?$",
       "description": "Maximum acceptable query price."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "network": {
       "type": "string"
      },
      "product": {
       "type": "string"
      },
      "activity": {
       "type": "object"
      },
      "identity": {
       "type": "object"
      },
      "assessment": {
       "type": "object"
      },
      "provenance": {
       "type": "object"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "network": "eip155:8453",
  "product": "indexed-chain-query-preflight",
  "assessment": {
   "flags": [],
   "risk_level": "low",
   "risk_score": 0
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent-buyer-identity-preflight-x402-purchase-governance-indexed-chain-b7483428/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from base-agent-preflight.bytoken2023.workers.dev](https://www.zero.xyz/host/base-agent-preflight.bytoken2023.workers.dev/llms.txt)
