{
  "openapi": "3.0.3",
  "info": {
    "title": "CSOAI Watchdog API",
    "version": "1.0.0",
    "description": "Independent AI-safety checks and Watchdog Certification by CSOAI (CSOAI LTD, UK 16939677). MCP JSON-RPC at /mcp/csoai; REST verify endpoints below. Signed results prove identity & integrity, not legal accuracy.",
    "contact": {"name": "CSOAI", "url": "https://csoai.org", "email": "hello@meok.ai"}
  },
  "servers": [{"url": "https://csoai.org"}],
  "paths": {
    "/mcp/csoai": {
      "post": {
        "summary": "MCP JSON-RPC 2.0 endpoint (tools/list, tools/call)",
        "description": "Tools: classify_ai_risk, crosswalk_frameworks, issue_watchdog_certification, validate_agent_card. Every tools/call response includes a _sigil signed attestation block. x402 pay-as-you-go per call.",
        "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object",
          "properties": {"jsonrpc": {"type": "string", "enum": ["2.0"]}, "id": {}, "method": {"type": "string"},
          "params": {"type": "object"}}, "required": ["jsonrpc", "method"]}}}},
        "responses": {"200": {"description": "JSON-RPC result with _sigil attestation"},
                      "402": {"description": "x402 payment challenge (PAYG)"}}
      }
    },
    "/verify/{cert_id}": {
      "get": {
        "summary": "Verify a Watchdog certificate by ID",
        "parameters": [{"name": "cert_id", "in": "path", "required": true, "schema": {"type": "string"}}],
        "responses": {"200": {"description": "{valid, reason, expired, cert_id}"}}
      }
    },
    "/verify": {
      "post": {
        "summary": "Verify a pasted certificate JSON (offline-equivalent check)",
        "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object"}}}},
        "responses": {"200": {"description": "{valid, reason, expired, cert_id}"}}
      }
    },
    "/pubkey": {
      "get": {"summary": "CSOAI Ed25519 public key — verify certificates fully offline",
              "responses": {"200": {"description": "{alg, pubkey, issuer}"}}}
    },
    "/healthz": {
      "get": {"summary": "Gateway health", "responses": {"200": {"description": "{hive, status, tools, ts}"}}}
    }
  }
}
