API Reference
Audit & Usage Logs
Forensic visibility — the audit log of sensitive actions and the per-request API usage log with cost-by-day rollups and CSV export.
Two complementary logs: the audit log records sensitive actions (key creation, role changes, logins, deactivation) for compliance; the API usage log records every billed request (model, latency, tokens, cost, status). Prompt/completion text is only retrievable when prompt logging is enabled on the key. Both export to CSV.
GET
/api/v1/audit/events AuthList audit events (sensitive actions)
Query Parameters
limitnumber (1-200)beforeISO8601 cursoractionfilter by action typeGET
/api/v1/audit/events/:event_id AuthGet a single audit event with full metadata
GET
/api/v1/audit/events.csv AuthExport audit events as CSV
GET
/api/v1/audit/api-logs AuthPer-request API usage rows (model, latency, cost, status)
Query Parameters
limitnumber (1-200)key_idUUIDservicellm | stt | tts | image | searchsince_daysnumber (1-365)GET
/api/v1/audit/api-logs/cost-by-day AuthDaily cost rollup for charting
Query Parameters
daysnumber (1-90)GET
/api/v1/audit/api-logs/:usage_id/content AuthGet prompt/completion text for a request (only if prompt logging was enabled on the key)
GET
/api/v1/audit/api-logs.csv AuthExport API usage logs as CSV
GET
/api/v1/keys/:id/logs AuthPer-key usage rows — alias scoped to one API key
GET
/api/v1/keys/:id/rate-state AuthLive per-key RPM consumption state
Was this page helpful?