Analytics
Daily usage for your tenant: active students, conversations, messages, tokens and estimated cost.
GET /analytics
Returns one row per day for your tenant, plus totals for the range. Figures cover conversations created through this API — nothing else is included.
Your tenant is taken from the API key. There is deliberately no tenant_id parameter: an endpoint that accepted one would be a typo away from showing you someone else's numbers.
Requires an API key with the
analyticspermissionfromandtoare calendar dates,YYYY-MM-DD; both optionalDefaults to the last 30 days
Maximum range is 366 days
Days with no activity are omitted rather than returned as zeroes
Figures are recomputed hourly;
meta.last_refreshed_attells you how current they are
curl -s 'https://ai.zabai.org/api/external/v1/analytics?from=2026-09-01&to=2026-09-30' -H 'Authorization: Bearer $MATH_AI_API_KEY'{
"success": true,
"request_id": "...",
"data": {
"from": "2026-09-01",
"to": "2026-09-30",
"days": [
{
"day": "2026-09-14",
"active_students": 2,
"chats_created": 2,
"messages": 62,
"total_tokens": 414886,
"estimated_cost_usd": 0.070889
}
],
"totals": {
"active_students": 4,
"chats_created": 3,
"messages": 92,
"total_tokens": 600500,
"estimated_cost_usd": 0.106767
}
},
"meta": {
"granularity": "day",
"last_refreshed_at": "2026-10-20T05:07:11.482Z"
}
}What the numbers mean
active_students— distinctexternal_user_idvalues seen that day. Intotalsit is counted across the whole range, not summed from the days, so a student active on ten days counts oncechats_created— conversations started that day. A day can show messages with zero chats created, which simply means your users continued earlier conversationsmessages— every turn, yours and the tutor'sestimated_cost_usd— our model cost for serving you, not a price. It is useful for spotting changes in usage; it is not an invoicemeta.last_refreshed_at— when we last recomputed these figures. Today's row can lag by up to an hour, so treat the current day as provisionalDays are UTC calendar days, not your local ones