{
  "openapi": "3.1.0",
  "info": {
    "title": "Sajilo Tool API",
    "version": "1.0.0",
    "description": "API and tool endpoints for Sajilo Tool - Nepal productivity utilities, financial calculations, and AI assistant.",
    "contact": {
      "name": "SajiloLabs",
      "url": "https://www.sajilotool.com"
    }
  },
  "servers": [
    {
      "url": "https://www.sajilotool.com",
      "description": "Production server"
    }
  ],
  "paths": {
    "/api/chat": {
      "post": {
        "summary": "AI Chat Assistant for Nepali utilities",
        "description": "Conversational assistant providing instant answers, tool guidance, and financial calculation context.",
        "operationId": "chatWithAssistant",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "messages": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "role": {
                          "type": "string",
                          "enum": ["user", "assistant", "system"]
                        },
                        "content": {
                          "type": "string"
                        }
                      },
                      "required": ["role", "content"]
                    }
                  }
                },
                "required": ["messages"]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Streamed text response or JSON completion",
            "content": {
              "text/plain": {},
              "application/json": {}
            }
          }
        }
      }
    }
  }
}
