{
  "openapi": "3.1.0",
  "info": {
    "title": "SIMCOAI API",
    "version": "1.0.0",
    "description": "Public integration surface for SIMCOAI account-connected website chat, conversations, knowledge search, events, escalations and orders."
  },
  "servers": [
    { "url": "https://api.simcoai.co.uk/v1" }
  ],
  "components": {
    "securitySchemes": {
      "SimcoApiKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "SIMCOAI API key"
      }
    }
  },
  "security": [{ "SimcoApiKey": [] }],
  "paths": {
    "/me": {
      "get": {
        "summary": "Identify API key account",
        "description": "Requires read scope.",
        "responses": { "200": { "description": "Account identity" }, "401": { "description": "Invalid key" }, "403": { "description": "Missing scope" } }
      }
    },
    "/chat": {
      "post": {
        "summary": "Create an AI chat response",
        "description": "Requires chat scope.",
        "responses": { "200": { "description": "AI reply" }, "403": { "description": "Missing scope" } }
      }
    },
    "/conversations": {
      "post": {
        "summary": "Create a conversation record",
        "description": "Requires conversations scope.",
        "responses": { "200": { "description": "Conversation recorded" } }
      }
    },
    "/knowledge/search": {
      "get": {
        "summary": "Search approved business knowledge",
        "description": "Requires knowledge scope.",
        "responses": { "200": { "description": "Knowledge search results" } }
      }
    },
    "/escalations": {
      "post": {
        "summary": "Create an escalation",
        "description": "Requires escalations scope.",
        "responses": { "200": { "description": "Escalation created" } }
      }
    },
    "/orders": {
      "get": {
        "summary": "List or search orders",
        "description": "Requires orders:read scope.",
        "responses": { "200": { "description": "Order records" } }
      },
      "post": {
        "summary": "Create an order",
        "description": "Requires orders:write scope.",
        "responses": { "200": { "description": "Order created" } }
      }
    }
  }
}
