{"uid":"cap_fgaCZKgdPiX4kKQsFgLGW","slug":"ontario-protocol-x402-pre-payment-decision-check-5d8a9d25","name":"Ontario Protocol x402 Pre-Payment Decision Check","description":"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.","url":"https://ontarioprotocol.com/api/agent/pay/v2","method":"POST","headers":{},"bodySchema":{"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."}}},"responseSchema":{"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"}}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_76cP4G_fIaMgHROCYFsiG","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"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.","exampleAgentPrompt":"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.","exampleUseCases":[{"title":"Guard agent against misconfigured paid APIs","prompt":"Before my agent calls that paid weather API at https://weather-api.example.com/forecast, run a strict pre-payment check on it and tell me if it's safe to pay — I don't want to authorize anything if the endpoint isn't properly configured."},{"title":"Budget cap enforcement before payment","prompt":"Check whether the x402 endpoint at https://data-provider.example.com/records is allowed under a standard policy, and deny payment if the declared price is over $0.005 USDC."},{"title":"Audit trail for autonomous agent payments","prompt":"My autonomous agent is about to pay for access to https://analytics.example.com/api/insights — run a permissive pre-payment readiness check and save the evidence receipt with the SHA-256 digest so I have a record of what was verified before it paid."}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-16T00:43:26.317Z","isFirstParty":false}