{"openapi":"3.1.0","info":{"title":"Apex Agent Tool Result Contract Validator","version":"1.0.0","description":"A deterministic JSON tool response validator for Agent Tool Result Envelope v1.0, suitable for MCP tool-output contract tests and test fixtures. It exposes a Base Sepolia test route and, when listed in the live manifest, a separately labelled Base mainnet USDC route."},"servers":[{"url":"https://apex-agent-tool-result-validator.apex-ai-assets.workers.dev"}],"paths":{"/v1/validate":{"get":{"summary":"Validate an envelope for free","parameters":[{"name":"payload","in":"query","required":true,"description":"URL-encoded JSON object","schema":{"type":"string","maxLength":8000},"example":"{\"schema_version\":\"1.0\",\"tool_name\":\"inventory_lookup\",\"status\":\"ok\",\"request_id\":\"req_123\",\"timestamp\":\"2026-10-30T00:00:00Z\",\"payload\":{\"sku\":\"demo-001\",\"available\":true}}"}],"responses":{"200":{"description":"Validation result"},"400":{"description":"Missing or malformed payload"},"413":{"description":"Payload too large"}}}},"/v1/premium/validate":{"get":{"summary":"Validate an envelope through x402 v2 (Base Sepolia testnet)","description":"Returns HTTP 402 and PAYMENT-REQUIRED until a valid x402 v2 Base Sepolia USDC payment signature is supplied in PAYMENT-SIGNATURE. Successful settlement returns PAYMENT-RESPONSE.","parameters":[{"name":"payload","in":"query","required":true,"schema":{"type":"string","maxLength":8000},"example":"{\"schema_version\":\"1.0\",\"tool_name\":\"inventory_lookup\",\"status\":\"ok\",\"request_id\":\"req_123\",\"timestamp\":\"2026-10-30T00:00:00Z\",\"payload\":{\"sku\":\"demo-001\",\"available\":true}}"}],"responses":{"200":{"description":"Settled validation result"},"402":{"description":"x402 payment required"},"502":{"description":"Facilitator unavailable"}}}},"/v1/premium/mainnet/xpay/validate":{"get":{"summary":"Validate an envelope through x402 v2 (Base mainnet USDC, xpay lane)","description":"Uses xpay's separately selected exact-v2 facilitator. A PAYMENT-SIGNATURE received on this route is never sent to CDP or PayAI.","parameters":[{"name":"payload","in":"query","required":true,"schema":{"type":"string","maxLength":8000},"example":"{\"schema_version\":\"1.0\",\"tool_name\":\"inventory_lookup\",\"status\":\"ok\",\"request_id\":\"req_123\",\"timestamp\":\"2026-10-30T00:00:00Z\",\"payload\":{\"sku\":\"demo-001\",\"available\":true}}"}],"responses":{"200":{"description":"Settled validation result"},"402":{"description":"x402 payment required"},"502":{"description":"Facilitator unavailable"}}}},"/.well-known/x402.json":{"get":{"summary":"x402 service manifest","responses":{"200":{"description":"Machine-readable x402 manifest"}}}},"/.well-known/x402-service.json":{"get":{"summary":"true402 service descriptor when production payment is configured","responses":{"200":{"description":"true402 machine-readable service descriptor"},"404":{"description":"Production payment not configured"}}}},"/healthz":{"get":{"summary":"Health check","responses":{"200":{"description":"Service healthy"}}}}},"components":{"schemas":{"AgentToolResultEnvelopeV1":{"type":"object","required":["schema_version","tool_name","status","request_id","timestamp","payload"],"additionalProperties":false,"properties":{"schema_version":{"type":"string","const":"1.0"},"tool_name":{"type":"string","minLength":1},"status":{"type":"string","enum":["ok","error"]},"request_id":{"type":"string","minLength":1},"timestamp":{"type":"string","format":"date-time"},"payload":{"type":"object"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"}},"required":["code","message","retryable"],"additionalProperties":false}}}}}}