HTTP reference

API — Chat, RAG, and medical report helpers

Route Handlers under src/app/api. Non-public routes expect a Supabase session cookie. Admin routes also require profiles.role = admin.

PublicCallable without a session where the handler allows it.Signed inRequires a signed-in user.AdminAdmin role on your profile.

Back to API overview

MethodsPathAccessSummary
POST/api/chatSigned inMain chat completion: context assembly, optional RAG, Gemini with Groq failover.
POST/api/chat/nearby-onceSigned inOne-shot nearby-facilities style completion for chat UX.
POST/api/rag/searchSigned inSemantic search over knowledge chunks (embeddings + RPC).
POST/api/rag/ingestAdminIngest a knowledge chunk into RAG tables (admin-only).
POST/api/reports/analyzeSigned inAnalyze uploaded medical report content with AI.
POST/api/reports/extract-localSigned inClient-side extraction helper endpoint for report pipeline.