{"openapi":"3.1.0","info":{"title":"x402 precheck","version":"1.0.0-precheck","description":"Check an x402 payment challenge BEFORE your agent pays (0.002 USDC per check via x402; free trial 1024 checks/IP/UTC day). Give an endpoint URL (fetched unpaid, never paid) or paste a 402 challenge. Validates x402 version, scheme, network (CAIP-2, testnet flag), canonical USDC asset, amount sanity, payTo format/EIP-55 checksum/zero address, EIP-712 domain, payment window, facilitator reachability and scheme/network support, optional maxPriceUsd / expectPayTo / expectNetwork policy, and PayAI Bazaar listing match. Returns per-check pass/warn/fail and a verdict: looks_ok, review or do_not_pay. Informational; invalid input and failed checks are not charged. Input rules: give url or challenge. Malformed input (bad URL, private/localhost host, non-http(s) scheme, credentials in URL, challenge not JSON/base64-JSON, no accepts[], option missing scheme/network/payTo, bad policy params, url > 2048 chars, challenge > 16384 chars) returns HTTP 400 {error, message, hint} before the paywall: no payment asked, no free-trial slot used (it still counts toward the service-wide daily request counter). A request with no input at all returns the 402 challenge (for directory indexing). Built and operated with AI assistance (an autonomous agent experiment); a human owner reviews it. Free trial: 1024 unpaid checks per IP per UTC day (HTTP and MCP share the bucket). After that, pay 0.002 USDC per check with x402. Global free cap 10000/day; trial auto-off if this service reaches 20000 requests/day.","x-guidance":"GET /v1/precheck?url=https://… or ?challenge=<base64 PAYMENT-REQUIRED or JSON> (0.002 USDC). Optional maxPriceUsd, expectPayTo, expectNetwork, facilitator. Verdict looks_ok | review | do_not_pay. Same tool over MCP at POST /mcp. Free trial: 1024 unpaid checks per IP per UTC day (HTTP and MCP share the bucket). After that, pay 0.002 USDC per check with x402. Global free cap 10000/day; trial auto-off if this service reaches 20000 requests/day."},"servers":[{"url":"https://x402-precheck.w0arvg81zlgf.workers.dev"}],"paths":{"/v1/precheck":{"get":{"operationId":"precheck","summary":"Check an x402 payment challenge before paying","description":"Check an x402 payment challenge BEFORE your agent pays (0.002 USDC per check via x402; free trial 1024 checks/IP/UTC day). Give an endpoint URL (fetched unpaid, never paid) or paste a 402 challenge. Validates x402 version, scheme, network (CAIP-2, testnet flag), canonical USDC asset, amount sanity, payTo format/EIP-55 checksum/zero address, EIP-712 domain, payment window, facilitator reachability and scheme/network support, optional maxPriceUsd / expectPayTo / expectNetwork policy, and PayAI Bazaar listing match. Returns per-check pass/warn/fail and a verdict: looks_ok, review or do_not_pay. Informational; invalid input and failed checks are not charged.","tags":["x402","preflight","payments","safety","validation"],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.002"},"protocols":[{"x402":{"network":"eip155:8453","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","payTo":"0xfD2af2efFAF08877a98A3a02F7ee28D8191A3952","scheme":"exact"}}]},"parameters":[{"name":"url","in":"query","required":false,"description":"x402 endpoint URL to probe (public http/https). Fetched unpaid; never paid.","schema":{"type":"string"}},{"name":"challenge","in":"query","required":false,"description":"Alternative to url: the 402 challenge itself (JSON body, or the base64 PAYMENT-REQUIRED header value). Takes precedence over url.","schema":{"type":"string"}},{"name":"method","in":"query","required":false,"description":"HTTP method used to probe url","schema":{"type":"string","enum":["GET","POST"],"default":"GET"}},{"name":"maxPriceUsd","in":"query","required":false,"description":"Policy: fail options priced above this many USD (USDC)","schema":{"type":"string"}},{"name":"expectPayTo","in":"query","required":false,"description":"Policy: fail options whose payTo differs from this address","schema":{"type":"string"}},{"name":"expectNetwork","in":"query","required":false,"description":"Policy: fail options not on this network (CAIP-2, e.g. eip155:8453)","schema":{"type":"string"}},{"name":"facilitator","in":"query","required":false,"description":"Facilitator base URL to test (https). Default: PayAI (mainnet) / x402.org (testnet).","schema":{"type":"string"}},{"name":"compareDirectory","in":"query","required":false,"description":"Compare live terms with the PayAI Bazaar listing (url mode)","schema":{"type":"string","enum":["true","false"],"default":"true"}}],"responses":{"200":{"description":"Check result","content":{"application/json":{"example":{"verdict":"looks_ok","recommendedAccept":0,"summary":{"pass":14,"warn":0,"fail":0,"info":1},"accepts":[{"index":0,"network":"eip155:8453","networkName":"Base","isCanonicalUsdc":true,"priceUsd":0.01,"payTo":"0x…"}],"checks":[{"id":"accepts[0].payTo","status":"pass","message":"valid address, checksum OK"}]}}}},"400":{"description":"Invalid input (not charged, no free-trial slot used): {error, message, hint}"},"402":{"description":"Payment Required (x402 v2 PAYMENT-REQUIRED header; decoded copy in body)"},"429":{"description":"Rate limited before payment (not charged)"}}}},"/mcp":{"post":{"operationId":"mcp","summary":"Remote MCP endpoint (streamable HTTP, stateless); tool x402_precheck paid via the x402 MCP transport.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"JSON-RPC response"}}}},"/health":{"get":{"operationId":"health","summary":"Health check","responses":{"200":{"description":"OK"}}}}}}