AI & Chat API¶
Endpoints for AI-powered text generation, batch analysis, chat session management, and AI system administration.
Generate Text (Chat)¶
Request body:
Sends a prompt to the AI model and returns the generated response. If chat_id is provided, the conversation continues within that existing session. If omitted, a new session is created.
Trigger Batch Analysis¶
Request body:
Queues an AI analysis job for the specified batch. The analysis runs asynchronously and creates issues when problems are detected.
List Chat Sessions¶
Returns all chat sessions for the authenticated user.
Get Chat History¶
Returns the full message history and details for a specific chat session.
Update Chat Session¶
Request body:
Renames a chat session. Only fields you include are changed.
Delete Chat Session¶
Permanently deletes a chat session and all of its messages.
AI Admin (Admin Only)¶
Endpoints for monitoring and managing AI provider health. These require admin-level permissions.
Get AI Health Status¶
Response:
{
"status": "healthy",
"providers": {
"gemini": {"circuit": "CLOSED", "available": true, "rate_remaining": 8},
"deepseek": {"circuit": "CLOSED", "available": true}
}
}
Returns the overall health status of all configured AI providers.
Get Circuit Breaker Status¶
Shows the circuit breaker state (CLOSED, OPEN, or HALF_OPEN), failure count, and recovery time for each AI provider.
Get Rate Limit Status¶
Shows remaining requests per minute/hour for each provider.
Reset Circuit Breaker¶
Manually closes a circuit to resume requests after the provider has recovered.
Trip Circuit Breaker¶
Request body:
Manually opens a circuit to block requests during maintenance. The duration is in seconds.
Related¶
- Batches & Data -- Batch data that AI analyzes
- Issues -- Issues created by AI analysis
- Settings & Admin -- AI settings at the organisation level
- API Overview -- Base URL, response format, and error codes