{
  "openapi": "3.1.0",
  "info": {
    "title": "BoxOfChocolates.ai Public Information API",
    "version": "1.0.0",
    "description": "A public, read-only API for official BoxOfChocolates.ai organization and initiative information. No authentication is required. Initiative responses include their safety boundaries. No deprecation or sunset is currently scheduled for v1.",
    "contact": {
      "name": "BoxOfChocolates.ai",
      "email": "info@boxofchocolates.ai",
      "url": "https://boxofchocolates.ai/contact/"
    },
    "license": {
      "name": "Public website terms",
      "url": "https://boxofchocolates.ai/privacy/"
    }
  },
  "externalDocs": {
    "description": "Developer resources and API lifecycle policy",
    "url": "https://boxofchocolates.ai/developers/"
  },
  "servers": [
    {
      "url": "https://boxofchocolates.ai/api/v1",
      "description": "Production read-only API"
    }
  ],
  "security": [],
  "tags": [
    { "name": "Organization", "description": "Official organization information." },
    { "name": "Initiatives", "description": "Current public initiatives and safety boundaries." }
  ],
  "paths": {
    "/": {
      "get": {
        "operationId": "getApiIndex",
        "summary": "Get API index",
        "description": "Returns the API version, authentication policy, and canonical endpoint paths.",
        "responses": {
          "200": {
            "description": "API index",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiIndex" } } }
          },
          "405": { "$ref": "#/components/responses/MethodNotAllowed" }
        }
      }
    },
    "/organization": {
      "get": {
        "operationId": "getOrganization",
        "tags": ["Organization"],
        "summary": "Get organization information",
        "description": "Returns the official organization description, contact, nonprofit-status update, and public machine interfaces.",
        "responses": {
          "200": {
            "description": "Organization information",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OrganizationResponse" } } }
          },
          "405": { "$ref": "#/components/responses/MethodNotAllowed" }
        }
      }
    },
    "/initiatives": {
      "get": {
        "operationId": "listInitiatives",
        "tags": ["Initiatives"],
        "summary": "List current initiatives",
        "description": "Returns every current public initiative with its stage, summary, and safety boundary.",
        "responses": {
          "200": {
            "description": "Initiative list",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InitiativeListResponse" } } }
          },
          "405": { "$ref": "#/components/responses/MethodNotAllowed" }
        }
      }
    },
    "/initiatives/{slug}": {
      "get": {
        "operationId": "getInitiative",
        "tags": ["Initiatives"],
        "summary": "Get one initiative",
        "description": "Returns one current public initiative by canonical slug.",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Canonical initiative slug.",
            "schema": { "type": "string", "enum": ["fcancer-ai", "guarddog"] }
          }
        ],
        "responses": {
          "200": {
            "description": "Initiative information",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InitiativeResponse" } } }
          },
          "404": {
            "description": "No initiative exists for that slug",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
          },
          "405": { "$ref": "#/components/responses/MethodNotAllowed" }
        }
      }
    }
  },
  "components": {
    "responses": {
      "MethodNotAllowed": {
        "description": "The endpoint is read-only and the requested method is not allowed.",
        "content": {
          "application/json": {
            "schema": { "$ref": "#/components/schemas/ErrorResponse" }
          }
        }
      }
    },
    "schemas": {
      "ApiIndex": {
        "type": "object",
        "required": ["name", "version", "description", "authentication", "endpoints"],
        "properties": {
          "name": { "type": "string" },
          "version": { "type": "string" },
          "description": { "type": "string" },
          "authentication": { "type": "string", "const": "none" },
          "endpoints": { "type": "object", "additionalProperties": { "type": "string" } }
        }
      },
      "Organization": {
        "type": "object",
        "required": ["id", "name", "description", "website", "contact", "nonprofitStatus", "api", "mcp"],
        "properties": {
          "id": { "type": "string" },
          "name": { "type": "string" },
          "description": { "type": "string" },
          "website": { "type": "string", "format": "uri" },
          "contact": { "type": "string", "format": "email" },
          "nonprofitStatus": { "type": "string" },
          "api": { "type": "object", "additionalProperties": { "type": "string" } },
          "mcp": { "type": "object", "additionalProperties": { "type": "string" } }
        }
      },
      "Initiative": {
        "type": "object",
        "required": ["slug", "name", "domain", "stage", "summary", "safetyBoundary"],
        "properties": {
          "slug": { "type": "string", "enum": ["fcancer-ai", "guarddog"] },
          "name": { "type": "string" },
          "domain": { "type": "string" },
          "stage": { "type": "string" },
          "summary": { "type": "string" },
          "safetyBoundary": { "type": "string" }
        }
      },
      "OrganizationResponse": {
        "type": "object",
        "required": ["data"],
        "properties": { "data": { "$ref": "#/components/schemas/Organization" } }
      },
      "InitiativeResponse": {
        "type": "object",
        "required": ["data"],
        "properties": { "data": { "$ref": "#/components/schemas/Initiative" } }
      },
      "InitiativeListResponse": {
        "type": "object",
        "required": ["data", "meta"],
        "properties": {
          "data": { "type": "array", "items": { "$ref": "#/components/schemas/Initiative" } },
          "meta": {
            "type": "object",
            "required": ["count"],
            "properties": { "count": { "type": "integer", "minimum": 0 } }
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "required": ["error"],
        "properties": {
          "error": {
            "type": "object",
            "required": ["code", "message"],
            "properties": {
              "code": { "type": "string" },
              "message": { "type": "string" },
              "details": { "type": "object", "additionalProperties": true }
            }
          }
        }
      }
    }
  }
}
