# Ontario Protocol x402 Pre-Payment Decision Check

> Ontario Protocol x402 Pre-Payment Decision Check is a paid API for AI agents from ontarioprotocol.com, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-16).

Probes a live x402 endpoint and returns an allow/deny payment decision with readiness evidence, price verification, and policy compliance before an AI agent pays.

## Facts

- Endpoint: POST https://ontarioprotocol.com/api/agent/pay/v2
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-16
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/ontario-protocol-x402-pre-payment-decision-check-5d8a9d25
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_fgaCZKgdPiX4kKQsFgLGW

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 ontario-protocol-x402-pre-payment-decision-check-5d8a9d25 -d '<json body>'
```

Example prompt: Before you pay anything, check if this x402 endpoint is ready and correctly priced — probe https://example.com/api/paid using a strict policy and flag it if the price is over $0.01 USDC.

## When to prefer this

Use this endpoint when an AI agent needs a pre-payment safety gate before autonomously paying for x402-gated APIs — especially when operating under strict budget controls, compliance requirements, or when you need a tamper-evident evidence receipt (SHA-256 digest + report ID) proving due diligence before payment. Prefer this over skipping checks entirely when running unattended agents that could waste USDC on broken or fraudulent endpoints. The three policy modes (strict/standard/permissive) make it suitable for both cautious production agents and more lenient development workflows.

## Known failure modes

- Invalid or unreachable endpoint URL — endpoint cannot be probed, decision denied with network error reason
- Endpoint does not return HTTP 402 — fails x402 compliance check, results in deny
- Declared price exceeds max_usdc policy threshold — decision denied with price_exceeded reason
- Malformed input schema — 400 error if required fields (endpoint) are missing
- x402 challenge present but settlement metadata incomplete — low readiness score, possible deny under strict policy
- Rate limit or service unavailability — 429 or 503 response from Ontario Protocol

## How this service works

Pre-payment x402 endpoint decision receipt for an AI agent before it pays. Checks the live HTTP 402 challenge, price, network, asset, readiness evidence, and strict, standard, or permissive can-pay policy; returns allow or deny, reasons, a report ID, settlement metadata, and a SHA-256 evidence digest.

## Output

Returns a JSON object containing: a decision field ('allow' or 'deny'), an agent_policy echo, a decision_code, a declared_price_usdc, a report object with a readiness grade ('ready', etc.), a numeric readiness_score, a report_id, a verification_age_hours value, a live_preflight boolean, reasons for the decision, a query_id, and an evidence_receipt containing a receipt_id, schema version, and SHA-256 digest algorithm identifier.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "query": {
   "type": "string",
   "maxLength": 500,
   "minLength": 1,
   "description": "Optional task context for the payment decision. When omitted, Ontario performs a general live x402 endpoint readiness check."
  },
  "endpoint": {
   "type": "string",
   "format": "uri",
   "description": "Public x402 paid API URL to probe and verify before an autonomous agent pays."
  },
  "max_usdc": {
   "type": "string",
   "description": "Optional maximum endpoint price allowed by the buyer policy."
  },
  "agent_policy": {
   "enum": [
    "strict",
    "standard",
    "permissive"
   ],
   "type": "string",
   "default": "strict",
   "description": "Policy posture used to produce the allow or deny decision."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "example": {
  "data": {
   "reasons": [],
   "decision": {
    "report": {
     "grade": "ready",
     "report_id": "vrf_example",
     "readiness_score": 100
    },
    "decision": "allow",
    "agent_policy": "strict",
    "decision_code": "ready_verified",
    "declared_price_usdc": "0.002",
    "verification_age_hours": 0.1
   },
   "live_preflight": true
  },
  "schema": "ontario.agent_pay_query.v1",
  "endpoint": "https://example.com/api/paid",
  "query_id": "aq_example",
  "evidence_receipt": {
   "schema": "ontario.agent_evidence_receipt.v1",
   "receipt_id": "aer_example",
   "digest_algorithm": "sha256"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/ontario-protocol-x402-pre-payment-decision-check-5d8a9d25/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from ontarioprotocol.com](https://www.zero.xyz/host/ontarioprotocol.com/llms.txt)
