{ "openapi": "3.0.3", "info": { "title": "Basilic API", "version": "1.0.0", "description": "Basilic API documentation" }, "components": { "schemas": {} }, "paths": { "/health": { "get": { "operationId": "healthCheck", "summary": "Returns server health status with current ISO datetime", "tags": ["health"], "description": "Health check endpoint", "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": ["ok", "now"], "properties": { "ok": { "type": "boolean", "enum": [true] }, "now": { "format": "date-time", "type": "string" } } } } } } } } }, "/": { "get": { "responses": { "200": { "description": "Default Response" } } } }, "/ai/chat": { "post": { "operationId": "chat", "summary": "Generate AI chat response", "tags": ["ai"], "description": "Chat with AI using OpenAI", "requestBody": { "content": { "application/json": { "schema": { "type": "object", "required": ["messages"], "properties": { "messages": { "minItems": 1, "type": "array", "items": { "type": "object", "required": ["role", "content"], "properties": { "role": { "anyOf": [ { "type": "string", "enum": ["user"] }, { "type": "string", "enum": ["assistant"] }, { "type": "string", "enum": ["system"] } ] }, "content": { "type": "string" } } } }, "model": { "default": "gpt-4o-mini", "type": "string" } } } } }, "required": true }, "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": ["text"], "properties": { "text": { "type": "string" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": ["code", "message"], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "500": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": ["code", "message"], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } }, "/ai/chat/stream": { "post": { "operationId": "chatStream", "summary": "Stream AI chat response", "tags": ["ai"], "description": "Stream AI chat response using OpenAI", "requestBody": { "content": { "application/json": { "schema": { "type": "object", "required": ["messages"], "properties": { "messages": { "minItems": 1, "type": "array", "items": { "type": "object", "required": ["role", "content"], "properties": { "role": { "anyOf": [ { "type": "string", "enum": ["user"] }, { "type": "string", "enum": ["assistant"] }, { "type": "string", "enum": ["system"] } ] }, "content": { "type": "string" } } } }, "model": { "default": "gpt-4o-mini", "type": "string" } } } } }, "required": true }, "responses": { "200": { "description": "Streaming text response", "content": { "application/json": { "schema": { "description": "Streaming text response", "type": "string" } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": ["code", "message"], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "500": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": ["code", "message"], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } } } }