Skip to main content

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.

note
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 Auth

List audit events (sensitive actions)

Query Parameters

limitnumber (1-200)
beforeISO8601 cursor
actionfilter by action type
GET/api/v1/audit/events/:event_id Auth

Get a single audit event with full metadata

GET/api/v1/audit/events.csv Auth

Export audit events as CSV

GET/api/v1/audit/api-logs Auth

Per-request API usage rows (model, latency, cost, status)

Query Parameters

limitnumber (1-200)
key_idUUID
servicellm | stt | tts | image | search
since_daysnumber (1-365)
GET/api/v1/audit/api-logs/cost-by-day Auth

Daily cost rollup for charting

Query Parameters

daysnumber (1-90)
GET/api/v1/audit/api-logs/:usage_id/content Auth

Get prompt/completion text for a request (only if prompt logging was enabled on the key)

GET/api/v1/audit/api-logs.csv Auth

Export API usage logs as CSV

GET/api/v1/keys/:id/logs Auth

Per-key usage rows — alias scoped to one API key

GET/api/v1/keys/:id/rate-state Auth

Live per-key RPM consumption state

Was this page helpful?