{"uid":"cap_NkJ_qbrrq_EPPQ69xpXSH","slug":"x402-pre-payment-safety-check-0643a0a3","name":"x402 Pre-Payment Safety Check","description":"Should my agent pay this x402 endpoint? Live pre-payment check of ANY x402 URL (never pays it): we GET the target unpaid and decode its 402 quote (PAYMENT-REQUIRED header for v2, JSON body for v1) -> x402 version, every accepts[] option with real USD price (atomic amount / decimals), network name, asset (is it canonical USDC on that chain?), scheme, payTo, maxTimeoutSeconds, resource URL match, Bazaar discovery schema present?, description, latency_ms and TLS.","url":"https://kr-x402-mvp.kgy5612.workers.dev/crypto/x402-check?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"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","properties":{"url":{"type":"string","examples":["https://kr-x402-mvp.kgy5612.workers.dev/crypto/ping"],"maxLength":2048,"description":"Absolute https URL of the x402 endpoint to check, with its query string (alias endpoint=; omitted = self-test on /crypto/ping)"},"method":{"enum":["GET","POST"],"type":"string","description":"Probe method (default GET)"},"max_usd":{"type":"number","minimum":0,"examples":[0.01],"description":"Optional budget per call in USD; sets within_budget"}},"additionalProperties":false}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":{"type":"json","example":{"url":"https://kr-x402-mvp.kgy5612.workers.dev/crypto/ping","flags":[],"options":[],"reasons":["402 quote parsed: 1 option(s)","cheapest $0.001 USDC on base"],"verdict":"SAFE_TO_PAY","resource":{"url":"https://kr-x402-mvp.kgy5612.workers.dev/crypto/ping","host_match":true,"description":"Paid heartbeat"},"reachable":true,"checked_at":"2026-10-30T07:30:00Z","latency_ms":180,"risk_score":0,"should_pay":true,"http_status":402,"x402_version":2,"bazaar_schema":true,"payto_onchain":{"chain":"base","is_contract":false,"usdc_balance":0.079},"within_budget":true,"cheapest_option":{"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","payTo":"0xe4be4d0bd82d8e68203deff81f79ede0529f2617","scheme":"exact","is_usdc":true,"network":"eip155:8453","price_usd":0.001,"asset_label":"USDC","network_name":"base","max_timeout_s":300}}},"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_sMAJhJXUoJkh697vBP9OH","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":"Fetches any x402-protected URL unpaid and decodes its 402 payment quote to expose pricing, network, asset, and risk signals before an agent commits funds","exampleAgentPrompt":"Before paying, check whether this x402 endpoint is safe and affordable — probe https://kr-x402-mvp.kgy5612.workers.dev/crypto/ping and tell me the verdict, price in USD, which network and asset it wants, and whether the payTo address looks legitimate.","exampleUseCases":[{"title":"Budget guard before paying an unknown API","prompt":"I found a new x402 API at https://api.example.com/data/prices — before my agent pays anything, can you check it, tell me the USD price per call, confirm it's USDC on Base, and flag any risks? My budget is $0.01 per call."},{"title":"Verify payTo address before onchain transfer","prompt":"Check the x402 quote on https://some-defi-agent.io/v1/signal — I want to see the payTo address, whether it's a contract or EOA, and whether the asset is canonical USDC before I approve the payment."},{"title":"Confirm Bazaar-listed endpoint before agent workflow","prompt":"My agent is about to call an x402 endpoint at https://marketplace.bazaar.ai/feeds/gas — can you verify it returns a Bazaar discovery schema, the version is x402 v2, and the latency is reasonable before we wire it into our pipeline?"}],"resultDescription":"A JSON object containing: a human-readable verdict (e.g. SAFE_TO_PAY), a boolean should_pay, a numeric risk_score (0–1), the cheapest payment option (price_usd, asset_label, network_name, payTo, scheme, is_usdc, max_timeout_s), whether the endpoint is within the requested budget, x402 protocol version, whether a Bazaar discovery schema is present, the resource URL and description, reachability status, latency_ms, TLS info, HTTP status, and a list of reasons and flags explaining the assessment.","failureModes":["Target URL is unreachable — reachable: false, no options decoded","Target URL does not return a 402 — verdict may indicate non-x402 endpoint","Malformed or missing PAYMENT-REQUIRED header — parse failure, empty options array","TLS error on target — flagged in flags array","Price exceeds max_usd — within_budget: false","Non-canonical asset (not USDC) — is_usdc: false flagged in cheapest_option","x402 version mismatch or unsupported scheme — flagged in reasons","Self-test fallback used when url param is omitted"],"whenToPreferThis":"Use this endpoint whenever an AI agent needs to pre-flight an x402-protected API before committing USDC — especially useful for budget enforcement (max_usd), asset/network validation (confirming canonical USDC on Base vs. other chains), risk scoring unknown payTo addresses, and confirming Bazaar schema compliance. Prefer this over blindly paying a 402 response when operating in automated pipelines where unexpected charges or malicious payTo addresses are a concern.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-31T18:42:23.400Z","isFirstParty":false,"canonicalSlug":"x402-pre-payment-safety-check-0643a0a3"}