{
  "openapi": "3.1.0",
  "info": {
    "title": "Recalibrate Content API",
    "version": "1.0.0",
    "description": "Read-only, key-free API over the Recalibrate library: articles, health portals, evidence-graded treatments and citable statistics. Free to use in AI assistants with attribution to Recalibrate (recalibratepain.com).",
    "license": {
      "name": "Recalibrate Open Citation Licence",
      "url": "https://www.recalibratepain.com/.well-known/ai-usage-policy.json"
    }
  },
  "servers": [
    {
      "url": "https://www.recalibratepain.com"
    }
  ],
  "paths": {
    "/api/ai/index": {
      "get": {
        "operationId": "getCatalogue",
        "summary": "Catalogue of every article, portal, hub and product",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    },
    "/api/ai/content/{slug}": {
      "get": {
        "operationId": "getArticle",
        "summary": "Full text of one article as markdown-ready JSON",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    },
    "/api/ai/search": {
      "get": {
        "operationId": "searchContent",
        "summary": "Keyword search across every article and portal chunk",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 8
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    },
    "/api/ai/evidence": {
      "get": {
        "operationId": "getEvidence",
        "summary": "Evidence-graded treatments, optionally filtered by condition",
        "parameters": [
          {
            "name": "condition",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    },
    "/api/ai/facts": {
      "get": {
        "operationId": "getFacts",
        "summary": "Citable statistics with sources",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    }
  }
}