Analytics API
Query GLM 5 API usage analytics with a management key — spend, requests, tokens, and per-model breakdowns across a bounded, explicitly requested time range.
The Analytics API exposes the same bounded query model used by Activity → Explore. Authenticate with a management key, not an inference key.
Discover available dimensions
GET
https://glm5.app/api/v1/analytics/metaThe response lists supported metrics, dimensions, public models, the current account's inference keys, and the maximum query window.
Query analytics
POST
https://glm5.app/api/v1/analytics/query{
"metric": "credits",
"dimension": "model",
"from": "2026-08-01T00:00:00.000Z",
"to": "2026-08-28T23:59:59.999Z"
}
Supported metrics:
requestscreditsinput_tokensoutput_tokenserrorslatency
Supported dimensions:
daymodelkeystatus
Queries are scoped to the management-key owner and limited to a 90-day window. The endpoint returns aggregated data only; it does not expose prompt or completion bodies.