Docs
Sage Chat API
Interact with Sage programmatically.
Endpoint
textPOST /api/v1/diagnose - Send a question to Sage
Request
bashcurl -X POST https://api.dbabrain.ai/api/v1/diagnose \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"question": "What is the most critical issue right now?"}'
Response
json{ "analysis": "Your most critical issue is a blocking chain...", "severity": "high", "metrics_used": ["pg_stat_activity", "pg_locks", "pg_stat_statements"], "timestamp": "2026-02-07T14:30:00Z" }
Streaming
The diagnose endpoint supports Server-Sent Events for streaming responses. Add Accept: text/event-stream header to receive the response as it is generated.