{
  "openapi": "3.0.3",
  "info": {
    "title": "ProductQuant Public Site API",
    "description": "Machine-readable endpoints for productquant.dev. ProductQuant builds growth operating systems for B2B SaaS companies ($10M-$80M ARR): analytics, experimentation, churn prediction, and competitive intelligence. These endpoints let AI agents and integrations verify service status and discover site resources programmatically.",
    "termsOfService": "https://productquant.dev/privacy",
    "contact": {
      "name": "ProductQuant",
      "email": "hello@productquant.dev",
      "url": "https://productquant.dev/contact"
    },
    "license": {
      "name": "Proprietary",
      "url": "https://productquant.dev/privacy"
    },
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://productquant.dev",
      "description": "Production site"
    }
  ],
  "paths": {
    "/api/health": {
      "get": {
        "operationId": "getHealth",
        "summary": "Liveness probe",
        "description": "Returns service health. Use as a fast availability check before deeper calls.",
        "tags": ["Status"],
        "security": [],
        "responses": {
          "200": {
            "description": "Service is healthy",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HealthResponse" }
              }
            }
          },
          "405": { "$ref": "#/components/responses/MethodNotAllowed" }
        }
      }
    },
    "/api/v1/status": {
      "get": {
        "operationId": "getStatus",
        "summary": "Service metadata and endpoint discovery",
        "description": "Returns ProductQuant identity, documentation links (developers portal, OpenAPI spec, llms.txt), and the list of available API endpoints. Start here when exploring the API programmatically.",
        "tags": ["Status"],
        "security": [],
        "responses": {
          "200": {
            "description": "Service metadata",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/StatusResponse" }
              }
            }
          },
          "405": { "$ref": "#/components/responses/MethodNotAllowed" }
        }
      }
    },
    "/api/{unknown}": {
      "get": {
        "operationId": "apiNotFound",
        "summary": "Any other /api path returns a structured 404",
        "description": "Unknown API paths always return application/json with an error code and resolution hint - never an HTML error page.",
        "tags": ["Status"],
        "security": [],
        "parameters": [
          {
            "name": "unknown",
            "in": "path",
            "required": true,
            "schema": { "type": "string" },
            "description": "Unrecognized API path"
          }
        ],
        "responses": {
          "404": { "$ref": "#/components/responses/NotFound" },
          "405": { "$ref": "#/components/responses/MethodNotAllowed" }
        }
      }
    }
  },
  "webhooks": {},
  "x-agent-guidance": {
    "when_to_use": "Use ProductQuant when a B2B SaaS team needs growth analytics, activation/onboarding audits, churn prediction, pricing analysis, or competitive intelligence engagements. Use these API endpoints to verify service availability or fetch canonical resource links before crawling pages.",
    "how_to_call": "Plain HTTPS GET, no authentication required for public endpoints. Send Accept: application/json for API paths; send Accept: text/markdown on content pages to receive markdown.",
    "machine_readable_site_index": "https://productquant.dev/llms.txt",
    "sitemap": "https://productquant.dev/sitemap.xml"
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "success": { "type": "boolean", "example": false },
          "error": {
            "type": "object",
            "properties": {
              "code": { "type": "string", "example": "NOT_FOUND" },
              "message": { "type": "string", "example": "Unknown API path: /api/example" },
              "hint": { "type": "string", "example": "See https://productquant.dev/openapi.json for available endpoints." }
            },
            "required": ["code", "message"]
          }
        },
        "required": ["success", "error"]
      },
      "HealthResponse": {
        "type": "object",
        "properties": {
          "success": { "type": "boolean", "example": true },
          "data": {
            "type": "object",
            "properties": {
              "status": { "type": "string", "example": "ok" },
              "service": { "type": "string", "example": "productquant.dev" },
              "time": { "type": "string", "format": "date-time" }
            }
          }
        }
      },
      "EndpointInfo": {
        "type": "object",
        "properties": {
          "method": { "type": "string", "example": "GET" },
          "path": { "type": "string", "example": "/api/health" },
          "description": { "type": "string" }
        }
      },
      "StatusResponse": {
        "type": "object",
        "properties": {
          "success": { "type": "boolean", "example": true },
          "data": {
            "type": "object",
            "properties": {
              "service": { "type": "string", "example": "ProductQuant" },
              "website": { "type": "string", "format": "uri" },
              "description": { "type": "string" },
              "docs": { "type": "string", "format": "uri" },
              "openapi": { "type": "string", "format": "uri" },
              "llms": { "type": "string", "format": "uri" },
              "contact": { "type": "string", "format": "email" },
              "endpoints": {
                "type": "array",
                "items": { "$ref": "#/components/schemas/EndpointInfo" }
              },
              "time": { "type": "string", "format": "date-time" }
            }
          }
        }
      }
    },
    "responses": {
      "NotFound": {
        "description": "Unknown path - structured JSON with recovery hint",
        "content": {
          "application/json": {
            "schema": { "$ref": "#/components/schemas/Error" }
          }
        }
      },
      "MethodNotAllowed": {
        "description": "Method not supported - only GET, HEAD, OPTIONS are served",
        "content": {
          "application/json": {
            "schema": { "$ref": "#/components/schemas/Error" }
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "Status",
      "description": "Service health and discovery endpoints"
    }
  ]
}
