{"success":true,"message":"API documentation generated.","timestamp":"2026-07-05T13:13:57.114Z","requestId":"481a2738-ae52-4291-9f24-7283b50cca04","data":{"name":"Uni Lann Pya API","version":"1.0.0","overview":"Uni Lann Pya provides verified university and career guidance for Myanmar students through thin API routes, deterministic rule-engine checks, and safe LLM-generated explanations.","basePath":"/","envelope":{"success":"boolean","message":"string","timestamp":"ISO-8601 string","requestId":"string","data":"endpoint-specific payload or null","meta":"safe response metadata or null","error":"public error object or null"},"endpoints":[{"method":"GET","path":"/api/health","description":"Check service health.","response":{"data":{"service":"uni-lann-pya"}}},{"method":"GET","path":"/api/docs","description":"Return machine-readable API documentation.","response":{"data":"API reference JSON"}},{"method":"POST","path":"/api/chat","description":"Generate verified university and career guidance. Valid requests consume one daily AI chat credit.","request":{"contentType":"application/json","body":{"message":"string, required, non-empty"},"example":{"message":"I want to find universities based on my matriculation marks."}},"response":{"data":{"answer":"string","recommendations":[{"rank":"number","universityName":"string","universityNameMm":"string","category":"string","minimumMarks":"number | null","durationYears":"number | null","degrees":"string[]","matchReason":"string"}],"followUpQuestions":"string[]"},"meta":{"intent":"string","language":"English | Myanmar | Mixed","recommendationCount":"number","dailyLimit":"number","dailyUsed":"number","dailyRemaining":"number","dailyResetAt":"ISO-8601 string"}},"errors":[{"status":400,"code":"INVALID_JSON","description":"Request body is not valid JSON."},{"status":400,"code":"VALIDATION_ERROR","description":"The message field is missing, empty, too long, or contains unsupported fields."},{"status":413,"code":"PAYLOAD_TOO_LARGE","description":"The request body is larger than the chat API accepts."},{"status":415,"code":"UNSUPPORTED_MEDIA_TYPE","description":"The chat endpoint only accepts application/json."},{"status":429,"code":"DAILY_LIMIT_EXCEEDED","description":"The browser has used all daily AI chat credits."},{"status":503,"code":"SERVICE_BUSY","description":"The server is already processing the maximum number of chat requests."},{"status":500,"code":"CHAT_PROCESSING_FAILED","description":"The server could not process the message."}]},{"method":"GET","path":"/api/chat/usage","description":"Return the current server-trusted daily chat usage without consuming a credit.","response":{"data":{"limit":"number","used":"number","remaining":"number","resetAt":"ISO-8601 string"}}}],"environment":[{"name":"DAILY_LIMIT_SECRET","required":true,"description":"Secret used to sign HttpOnly daily usage cookies. Required in production."},{"name":"GEMINI_API_KEY","required":true,"description":"API key used by server-side AI extraction and generation."},{"name":"MODEL_NAME","required":false,"defaultValue":"gemini-2.5-flash-lite","description":"Chat model used by the server-side AI client."},{"name":"MAX_CONCURRENT_CHAT_REQUESTS","required":false,"defaultValue":3,"description":"Maximum number of active chat requests allowed per server instance. Must be between 1 and 25."}],"storage":[{"name":"localStorage","purpose":"Stores sessionId and Working Memory on the client.","items":["sessionId","workingMemory"]},{"name":"HttpOnly cookie","purpose":"Stores the server-signed daily AI chat usage counter for one browser.","items":["daily chat date","daily chat count","server signature"]},{"name":"IndexedDB","purpose":"Stores Conversation Memory and cached client data.","items":["conversations","messages","conversation summaries","cached recommendations"]},{"name":"Working Memory","purpose":"Tracks the active student profile for the current session.","items":["marks","category","major","careerGoal","language","lastIntent"]},{"name":"Conversation Memory","purpose":"Tracks recent conversation context; prompts should use only recent or summarized context.","items":["recent messages","summaries"]}]},"meta":null,"error":null}