{
  "openapi": "3.1.0",
  "info": {
    "title": "The Pitz Studio API",
    "description": "API for generating context-aware examples of digital tool concepts. Powers interactive learning experiences on the site.",
    "version": "1.0.0",
    "contact": {
      "name": "Noam Castel",
      "email": "noam@thepitz.studio",
      "url": "https://about.thepitz.studio"
    }
  },
  "servers": [
    {
      "url": "https://about.thepitz.studio",
      "description": "Production"
    }
  ],
  "paths": {
    "/api/generate-example": {
      "post": {
        "operationId": "generateExample",
        "summary": "Generate a context-aware example",
        "description": "Generates a practical example for a given digital tool concept or definition. Rate limited to 5 requests per day per IP and 300 requests per month globally. Note: direct API access is restricted to authorized origins; external agents should use the MCP transport at /api/mcp instead.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["title", "definition"],
                "properties": {
                  "title": {
                    "type": "string",
                    "description": "Short title for the digital tool concept (e.g. 'AI Chatbot')."
                  },
                  "definition": {
                    "type": "string",
                    "maxLength": 3000,
                    "description": "The concept or definition to generate an example for."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully generated example",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "example": {
                      "type": "string",
                      "description": "The generated example text."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input — missing or too-long definition"
          },
          "403": {
            "description": "Access denied — direct API access is restricted to authorized origins. Use the MCP transport at /api/mcp for external access."
          },
          "405": {
            "description": "Method not allowed — only POST is accepted"
          },
          "429": {
            "description": "Rate limit exceeded"
          },
          "500": {
            "description": "Server error"
          }
        }
      }
    }
  }
}
