{ "openapi": "3.0.0", "info": { "title": "Hello-GenAI API", "description": "A simple API for interacting with GenAI language models", "version": "1.0.0" }, "servers": [ { "url": "/", "description": "Current server" } ], "paths": { "/": { "get": { "summary": "Web Interface", "description": "Returns the HTML page for the chat interface", "responses": { "200": { "description": "HTML page with chat interface", "content": { "text/html": { "schema": { "type": "string" } } } } } } }, "/api/chat": { "post": { "summary": "Chat with AI", "description": "Send a message to the AI and get a response", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": ["message"], "properties": { "message": { "type": "string", "description": "The message to send to the AI", "example": "What is machine learning?" } } } } } }, "responses": { "200": { "description": "Successful response from AI", "content": { "application/json": { "schema": { "type": "object", "properties": { "response": { "type": "string", "description": "The AI's response to the message", "example": "Machine learning is a branch of artificial intelligence that focuses on building systems that learn from data." }, "model": { "type": "string", "description": "The model name (only returned for !modelinfo command)", "example": "gpt-3.5-turbo" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message", "example": "Message is required and must be a string" } } } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message", "example": "Failed to get response from LLM" } } } } } }, "429": { "description": "Too many requests", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Rate limit exceeded message", "example": "Rate limit exceeded. Try again in 60 seconds." } } } } } } } } }, "/health": { "get": { "summary": "Health Check", "description": "Check the health status of the application", "responses": { "200": { "description": "Health status information", "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "type": "string", "description": "Overall health status", "example": "healthy" }, "llm_api": { "type": "string", "description": "Status of the LLM API connection", "example": "ok" }, "timestamp": { "type": "string", "description": "ISO timestamp of the health check", "example": "2023-09-15T12:34:56.789Z" } } } } } } } } } } }