{
  "openapi": "3.1.0",
  "info": {
    "title": "ClientProof Agent API",
    "version": "0.1.0",
    "description": "Minimal OpenAPI surface for acquisition. Full MCP tool shapes live in GET /api/mcp. Seat billing on useclientproof.com is Stripe; this documents read-only agent tools."
  },
  "servers": [{ "url": "https://useclientproof.com" }],
  "paths": {
    "/api/mcp": {
      "get": {
        "summary": "MCP tool catalog",
        "description": "Public catalog JSON (tools, auth notes). No secret required.",
        "responses": {
          "200": { "description": "Catalog document" }
        }
      },
      "post": {
        "summary": "JSON-RPC MCP gateway",
        "description": "Streamable HTTP JSON-RPC: initialize (handshake), optional client notification notifications/initialized, tools/list, and tools/call. Requires Authorization: Bearer cp_mcp_* or an authenticated studio session. Send Accept: application/json, text/event-stream for compliant clients.",
        "security": [{ "bearerAuth": [] }],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": { "type": "string", "const": "2.0" },
                  "id": { "type": "integer" },
                  "method": { "type": "string", "enum": ["initialize", "tools/list", "tools/call"] }
                },
                "required": ["jsonrpc", "id", "method"]
              }
            }
          }
        },
        "responses": {
          "200": { "description": "JSON-RPC result" },
          "401": {
            "description": "Missing or invalid credentials; includes WWW-Authenticate with oauth-protected-resource metadata URL"
          }
        }
      }
    },
    "/see-how-it-works": {
      "get": {
        "summary": "Ungated product tour",
        "description": "Marketing HTML walkthrough — workspaces, approval queue, embeds. No email gate.",
        "responses": {
          "200": { "description": "Tour page" }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Agent API key from Dashboard → MCP (prefix cp_mcp_)."
      }
    }
  }
}
