AI Logs API
View AI model usage logs and aggregated token consumption. Superadmin only.
Endpoints Overview
| Method | Endpoint | Description |
|---|---|---|
| GET | /admin/ai-logs | List AI logs |
| GET | /admin/ai-logs/usage | Token usage summary |
| GET | /admin/ai-logs/usage/guardrail-impact | Guardrail impact summary |
| GET | /admin/ai-logs/{id} | Get AI log detail |
| POST | /admin/ai-logs/{id}/replay | Replay a logged prompt |
| POST | /admin/ai-logs/{id}/save-prompt | Save prompt candidate from a log |
List AI Logs
GET /admin/ai-logs
| Parameter | Type | Description |
|---|---|---|
skip | integer | Pagination offset |
limit | integer | Page size (default 50) |
provider | string | Filter by provider |
status | string | Filter by status |
feature | string | Filter by feature area |
Token Usage Summary
GET /admin/ai-logs/usage?days=30
Returns aggregated token usage grouped by date, model, and feature. Useful for cost monitoring.