{"openapi":"3.1.0","info":{"title":"x402 Preflight","version":"1.0.0","description":"Inspect and validate an unfamiliar x402 endpoint before an agent spends USDC. x402 Preflight observes the challenge, price, network, asset, receiver, discovery metadata, CORS, and operational signals without signing or paying for the buyer.","x-claim-boundary":"Preflight reports are time-bound observations, not guarantees of settlement, delivery, seller trust, or contract safety."},"servers":[{"url":"https://x402-wallet-readiness-service.vercel.app"}],"tags":[{"name":"preflight","description":"The three canonical agent capabilities."},{"name":"labs","description":"Backward-compatible experimental routes not included as primary operations."}],"paths":{"/api/preflight/inspect":{"post":{"tags":["preflight"],"operationId":"inspect_x402_endpoint","summary":"Inspect an x402 endpoint before spending","description":"Use before paying an unfamiliar x402 resource. Performs a free read-only probe and returns a deterministic policy decision from the observed challenge and caller limits.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreflightInput"}}}},"responses":{"200":{"description":"Deterministic structured result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreflightReport"}}}},"400":{"description":"Invalid or blocked target.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The target or facilitator was unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"504":{"description":"The target timed out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/x402/preflight/audit":{"get":{"tags":["preflight"],"operationId":"audit_x402_endpoint_query","summary":"Run a deep paid x402 endpoint audit over query parameters","description":"Compatibility GET alias for audit_x402_endpoint. Supply a public HTTPS resource_url and optional policy limits in the query string; only GET and HEAD targets are accepted.","parameters":[{"name":"resource_url","in":"query","required":true,"description":"Public HTTPS x402 resource to inspect without payment credentials.","schema":{"type":"string","format":"uri","pattern":"^https://","maxLength":2048,"description":"Public HTTPS x402 resource to inspect without payment credentials."}},{"name":"method","in":"query","required":false,"description":"Target request method. The GET alias accepts GET or HEAD only.","schema":{"type":"string","enum":["GET","HEAD"],"default":"GET"}},{"name":"expected_network","in":"query","required":false,"description":"Expected CAIP-2 payment network; defaults to the service network.","schema":{"type":"string","pattern":"^[a-z0-9]+:[A-Za-z0-9._-]+$","maxLength":100,"default":"eip155:8453"}},{"name":"max_price_usd","in":"query","required":false,"description":"Maximum acceptable target price in USD.","schema":{"type":"number","minimum":0,"maximum":1000000}}],"x-compatibility":true,"x-primary-capability":"audit_x402_endpoint","x-payment-info":{"required":true,"protocol":"x402","scheme":"exact","priceUsd":0.05,"network":"eip155:8453","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","payTo":"0x820a7bf90d944bb26bfD9b62Ab172Fc3A0829cB9","facilitator":"https://facilitator.world.fun","runtimeAuthority":true},"responses":{"200":{"description":"Deterministic structured result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreflightReport"}}}},"400":{"description":"Invalid or blocked target.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"402":{"description":"x402 payment challenge. Runtime values are authoritative.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentRequired"}}}},"502":{"description":"The target or facilitator was unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"504":{"description":"The target timed out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"tags":["preflight"],"operationId":"audit_x402_endpoint","summary":"Run a deep paid x402 endpoint audit","description":"Use when a buyer needs deeper evidence before spending: validates payment requirements, redirects, CORS, cache behavior, OpenAPI, llms.txt, agent metadata, and x402 discovery consistency.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreflightInput"}}}},"x-payment-info":{"required":true,"protocol":"x402","scheme":"exact","priceUsd":0.05,"network":"eip155:8453","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","payTo":"0x820a7bf90d944bb26bfD9b62Ab172Fc3A0829cB9","facilitator":"https://facilitator.world.fun","runtimeAuthority":true},"responses":{"200":{"description":"Deterministic structured result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreflightReport"}}}},"400":{"description":"Invalid or blocked target.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"402":{"description":"x402 payment challenge. Runtime values are authoritative.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentRequired"}}}},"502":{"description":"The target or facilitator was unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"504":{"description":"The target timed out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/x402/preflight/remediation":{"post":{"tags":["preflight"],"operationId":"order_x402_remediation","summary":"Order remediation for a failed x402 preflight","description":"Use after a failed or risky audit to purchase a durable remediation intake for the endpoint. This creates an order; it never deploys changes or spends automatically.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemediationInput"}}}},"x-payment-info":{"required":true,"protocol":"x402","scheme":"exact","priceUsd":100,"network":"eip155:8453","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","payTo":"0x820a7bf90d944bb26bfD9b62Ab172Fc3A0829cB9","facilitator":"https://facilitator.world.fun","runtimeAuthority":true},"responses":{"200":{"description":"Deterministic structured result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemediationReceipt"}}}},"400":{"description":"Invalid or blocked target.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"402":{"description":"x402 payment challenge. Runtime values are authoritative.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentRequired"}}}},"502":{"description":"The target or facilitator was unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"504":{"description":"The target timed out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}}},"components":{"schemas":{"PreflightInput":{"type":"object","additionalProperties":false,"required":["resource_url"],"properties":{"resource_url":{"type":"string","format":"uri","pattern":"^https://","maxLength":2048,"description":"Public HTTPS x402 resource to inspect without payment credentials."},"method":{"type":"string","enum":["GET","HEAD","POST"],"default":"GET"},"expected_network":{"type":"string","pattern":"^[a-z0-9]+:[A-Za-z0-9._-]+$","maxLength":100},"max_price_usd":{"type":"number","minimum":0,"maximum":1000000}}},"PreflightReport":{"type":"object","additionalProperties":false,"required":["profile","decision","score","requestId","observedAt","expiresAt","resource","payment","cors","checks","issues","discovery","operational","evidence","claimBoundary"],"properties":{"profile":{"type":"string","enum":["inspect","audit"]},"decision":{"type":"string","enum":["ALLOW","CAUTION","BLOCK","UNKNOWN"]},"score":{"type":"integer","minimum":0,"maximum":100},"requestId":{"type":"string","pattern":"^req_[A-Za-z0-9_-]+$"},"observedAt":{"type":"string","format":"date-time"},"expiresAt":{"type":"string","format":"date-time"},"resource":{"type":"object","additionalProperties":false,"required":["url","method","finalUrl","statusCode","latencyMs"],"properties":{"url":{"type":"string","format":"uri"},"method":{"type":"string","enum":["GET","HEAD","POST"]},"finalUrl":{"type":"string","format":"uri"},"statusCode":{"type":["integer","null"]},"latencyMs":{"type":"integer","minimum":0}}},"payment":{"type":"object","additionalProperties":false,"required":["detected","challengeSource","x402Version","scheme","network","asset","amountAtomic","priceUsd","payTo","facilitator","maxTimeoutSeconds","bazaar"],"properties":{"detected":{"type":"boolean"},"challengeSource":{"type":["string","null"],"enum":["header","body",null]},"x402Version":{"type":["integer","null"]},"scheme":{"type":["string","null"]},"network":{"type":["string","null"]},"asset":{"type":["string","null"]},"amountAtomic":{"type":["string","null"]},"priceUsd":{"type":["number","null"]},"payTo":{"type":["string","null"]},"facilitator":{"type":["string","null"]},"maxTimeoutSeconds":{"type":["integer","null"]},"bazaar":{"type":"object","additionalProperties":false,"required":["found","valid","type","method","toolName","description","inputSchemaPresent","outputSchemaPresent","examplePresent"],"properties":{"found":{"type":"boolean"},"valid":{"type":["boolean","null"]},"type":{"type":["string","null"]},"method":{"type":["string","null"]},"toolName":{"type":["string","null"]},"description":{"type":["string","null"]},"inputSchemaPresent":{"type":"boolean"},"outputSchemaPresent":{"type":"boolean"},"examplePresent":{"type":"boolean"}}}}},"cors":{"type":"object","additionalProperties":false,"required":["allowOrigin","allowMethods","allowHeaders","exposeHeaders","allowCredentials","browserAgentCompatible"],"properties":{"allowOrigin":{"type":["string","null"]},"allowMethods":{"type":"array","items":{"type":"string"}},"allowHeaders":{"type":"array","items":{"type":"string"}},"exposeHeaders":{"type":"array","items":{"type":"string"}},"allowCredentials":{"type":["boolean","null"]},"browserAgentCompatible":{"type":["boolean","null"]}}},"checks":{"type":"array","maxItems":100,"items":{"type":"object","additionalProperties":false,"required":["id","status","severity","evidence"],"properties":{"id":{"type":"string","maxLength":120},"status":{"type":"string","enum":["PASS","WARN","FAIL","UNKNOWN"]},"severity":{"type":"string","enum":["critical","high","medium","low","info"]},"evidence":{"type":"string","maxLength":2000}}}},"issues":{"type":"array","maxItems":100,"items":{"type":"object","additionalProperties":false,"required":["code","severity","retryable","message","remediation"],"properties":{"code":{"type":"string","pattern":"^[A-Z0-9_]+$"},"severity":{"type":"string","enum":["critical","high","medium","low","info"]},"retryable":{"type":"boolean"},"message":{"type":"string","maxLength":2000},"remediation":{"type":"string","maxLength":2000}}}},"discovery":{"type":"object","additionalProperties":false,"required":["openapi","llmsTxt","agentMetadata","x402Metadata"],"properties":{"openapi":{"type":"object","additionalProperties":false,"required":["url","statusCode","contentType","present","valid","consistent"],"properties":{"url":{"type":"string"},"statusCode":{"type":["integer","null"]},"contentType":{"type":["string","null"]},"present":{"type":"boolean"},"valid":{"type":["boolean","null"]},"consistent":{"type":["boolean","null"]}}},"llmsTxt":{"type":"object","additionalProperties":false,"required":["url","statusCode","contentType","present","valid","consistent"],"properties":{"url":{"type":"string"},"statusCode":{"type":["integer","null"]},"contentType":{"type":["string","null"]},"present":{"type":"boolean"},"valid":{"type":["boolean","null"]},"consistent":{"type":["boolean","null"]}}},"agentMetadata":{"type":"object","additionalProperties":false,"required":["url","statusCode","contentType","present","valid","consistent"],"properties":{"url":{"type":"string"},"statusCode":{"type":["integer","null"]},"contentType":{"type":["string","null"]},"present":{"type":"boolean"},"valid":{"type":["boolean","null"]},"consistent":{"type":["boolean","null"]}}},"x402Metadata":{"type":"object","additionalProperties":false,"required":["url","statusCode","contentType","present","valid","consistent"],"properties":{"url":{"type":"string"},"statusCode":{"type":["integer","null"]},"contentType":{"type":["string","null"]},"present":{"type":"boolean"},"valid":{"type":["boolean","null"]},"consistent":{"type":["boolean","null"]}}}}},"operational":{"type":"object","additionalProperties":false,"required":["contentType","cacheControl","responseBytes","timeoutMs","redirectChain"],"properties":{"contentType":{"type":["string","null"]},"cacheControl":{"type":["string","null"]},"responseBytes":{"type":"integer","minimum":0},"timeoutMs":{"type":"integer","minimum":1},"redirectChain":{"type":"array","maxItems":5,"items":{"type":"object","additionalProperties":false,"required":["from","to","statusCode"],"properties":{"from":{"type":"string","format":"uri"},"to":{"type":"string","format":"uri"},"statusCode":{"type":"integer","minimum":300,"maximum":399}}}}}},"evidence":{"type":"array","maxItems":100,"items":{"type":"object","additionalProperties":false,"required":["id","source","observation"],"properties":{"id":{"type":"string","maxLength":120},"source":{"type":"string","maxLength":500},"observation":{"type":"string","maxLength":2000}}}},"claimBoundary":{"type":"object","additionalProperties":false,"required":["proves","doesNotProve"],"properties":{"proves":{"type":"array","items":{"type":"string"}},"doesNotProve":{"type":"array","items":{"type":"string"}}}}}},"RemediationInput":{"type":"object","additionalProperties":false,"required":["resource_url","goal"],"properties":{"resource_url":{"type":"string","format":"uri","pattern":"^https://","maxLength":500},"goal":{"type":"string","minLength":1,"maxLength":800},"contact":{"type":"string","maxLength":300},"constraints":{"type":"string","maxLength":1000},"callback_url":{"type":"string","format":"uri","pattern":"^https://","maxLength":2000},"response_format":{"type":"string","enum":["json","markdown","both"],"default":"both"},"language":{"type":"string","minLength":2,"maxLength":20,"default":"en"}}},"RemediationReceipt":{"type":"object","additionalProperties":false,"required":["capability","service","orderId","status","acceptedAt","payment","request","review","persistence","claimBoundary"],"properties":{"capability":{"type":"string","const":"order_x402_remediation"},"service":{"type":"string"},"orderId":{"type":"string"},"status":{"type":"string"},"acceptedAt":{"type":"string","format":"date-time"},"payment":{"type":"object","additionalProperties":false,"required":["asset","assetContract","network","networkCaip2","expectedAmountAtomic","expectedAmountUsd","payTo","facilitator"],"properties":{"asset":{"type":"string"},"assetContract":{"type":"string"},"network":{"type":"string"},"networkCaip2":{"type":"string"},"expectedAmountAtomic":{"type":"string"},"expectedAmountUsd":{"type":"number"},"payTo":{"type":"string"},"facilitator":{"type":"string","format":"uri"}}},"request":{"type":"object","additionalProperties":false,"required":["repository_or_url","goal","contact","constraints","callback_url","response_format","language"],"properties":{"repository_or_url":{"type":"string"},"goal":{"type":"string"},"contact":{"type":"string"},"constraints":{"type":"string"},"callback_url":{"type":"string"},"response_format":{"type":"string","enum":["json","markdown","both"]},"language":{"type":"string"}}},"review":{"type":"object","additionalProperties":false,"required":["status","statusUrl","resultUrl","reportUrl","estimatedCompletionMinutes","accessToken"],"properties":{"status":{"type":"string"},"statusUrl":{"type":"string","format":"uri"},"resultUrl":{"type":"string","format":"uri"},"reportUrl":{"type":"string","format":"uri"},"estimatedCompletionMinutes":{"type":"integer","minimum":1},"accessToken":{"type":"string"}}},"persistence":{"type":"object","additionalProperties":false,"required":["status","settlementTracking"],"properties":{"status":{"type":"string"},"settlementTracking":{"type":"boolean"}}},"claimBoundary":{"type":"object","additionalProperties":false,"required":["proves","doesNotProve"],"properties":{"proves":{"type":"array","items":{"type":"string"}},"doesNotProve":{"type":"array","items":{"type":"string"}}}}}},"ErrorEnvelope":{"type":"object","additionalProperties":false,"required":["error"],"properties":{"error":{"type":"object","additionalProperties":false,"required":["code","message","retryable","retryAfterMs","requestId"],"properties":{"code":{"type":"string","pattern":"^[A-Z0-9_]+$"},"message":{"type":"string"},"retryable":{"type":"boolean"},"retryAfterMs":{"type":["integer","null"],"minimum":0},"requestId":{"type":"string"}}}}},"PaymentRequired":{"type":"object","additionalProperties":false,"required":["x402Version","accepts","resource"],"properties":{"x402Version":{"type":"integer","enum":[2]},"error":{"type":"string"},"accepts":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["scheme","network","asset","amount","payTo","maxTimeoutSeconds"],"properties":{"scheme":{"type":"string"},"network":{"type":"string"},"asset":{"type":"string"},"amount":{"type":"string","pattern":"^\\d+$"},"payTo":{"type":"string"},"maxTimeoutSeconds":{"type":"integer"},"extra":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string"},"version":{"type":"string"}}}}}},"resource":{"type":"object","additionalProperties":false,"required":["url","description","mimeType"],"properties":{"url":{"type":"string"},"description":{"type":"string"},"mimeType":{"type":"string"}}},"extensions":{"type":"object","additionalProperties":false,"properties":{"bazaar":{"type":"object"}}}}}}},"x-mcp-endpoint":"https://x402-wallet-readiness-service.vercel.app/mcp","x-labs":[{"category":"wallet","endpoint":"https://x402-wallet-readiness-service.vercel.app/api/preview","status":"labs"},{"category":"wallet","endpoint":"https://x402-wallet-readiness-service.vercel.app/api/readiness","status":"legacy"},{"category":"market","endpoint":"https://x402-wallet-readiness-service.vercel.app/api/market/crypto-snapshot","status":"labs"},{"category":"market","endpoint":"https://x402-wallet-readiness-service.vercel.app/api/market/ohlcv","status":"labs"},{"category":"developer","endpoint":"https://x402-wallet-readiness-service.vercel.app/api/dev/repo-snapshot","status":"labs"},{"category":"weather","endpoint":"https://x402-wallet-readiness-service.vercel.app/api/weather/current","status":"labs"},{"category":"services","endpoint":"https://x402-wallet-readiness-service.vercel.app/api/x402/services/quick-review","status":"legacy"},{"category":"services","endpoint":"https://x402-wallet-readiness-service.vercel.app/api/x402/services/integration-triage","status":"legacy"},{"category":"preflight","endpoint":"https://x402-wallet-readiness-service.vercel.app/api/x402/preflight/audit?resource_url=https%3A%2F%2Fexample.com%2Fapi%2Fresource&method=GET&expected_network=eip155%3A8453&max_price_usd=1","method":"GET","status":"compatibility","description":"GET compatibility alias for audit_x402_endpoint; requires a public HTTPS resource_url query parameter and only audits GET or HEAD targets."}]}