Analytics API
Read what the assistant cost and what people did with it. There is no /analytics router: the numbers come from two surfaces, /token-usage for model spend and /activity for interactions. Paths are relative to the base URL described in Authentication, and every call carries Authorization: Bearer <token>.
Token usage
The caller's own rows
curl 'https://api.appilot.space/token-usage/user?start_date=2026-01-01&limit=50' \
-H 'Authorization: Bearer <token>'
Query parameters:
| Parameter | Type | Description |
|---|---|---|
domain | string | Filter by domain |
app_id | number | Filter by application |
source | string | One of extension, backoffice, platform-admin |
provider | string | One of openai, gemini |
model | string | Filter by model id |
operation | string | Filter by operation type |
start_date, end_date | string | ISO date, YYYY-MM-DD, expanded to cover the whole day |
page, limit | number | Pagination, default page 1 and limit 50, limit capped at 100 |
The source and provider filters take a closed list and drop anything else silently rather than answering 400. Rows recorded for a provider outside that list, DeepSeek among them, are returned by an unfiltered call but cannot be selected with provider=.
Response:
{
"success": true,
"data": [
{
"id": 1,
"user_id": 1,
"organization_id": 1,
"domain": "example.com",
"source": "extension",
"provider": "deepseek",
"model": "deepseek-chat",
"operation": "chat",
"prompt_tokens": 150,
"completion_tokens": 200,
"total_tokens": 350,
"cost_usd": 0.0,
"created_at": "2026-01-15T10:00:00.000Z"
}
],
"pagination": { "page": 1, "limit": 50, "total": 100, "totalPages": 2 }
}
Aggregates
| Endpoint | Returns |
|---|---|
GET /token-usage/user/stats | The caller's totals, plus a byPeriod series (period query parameter: day, week, month) and a byDomain breakdown |
GET /token-usage/organization | The organization's rows and its aggregate. Requires an active organization context, otherwise 400 |
GET /token-usage/stats | The organization's aggregate on its own, without the rows |
GET /token-usage/domain/:domain | Rows and aggregate for one domain. URL-encode the domain |
Aggregate bodies use the same field names throughout: total_tokens, prompt_tokens, completion_tokens, total_cost_usd, count.
curl 'https://api.appilot.space/token-usage/user/stats?period=week' \
-H 'Authorization: Bearer <token>'
{
"success": true,
"aggregated": {
"total_tokens": 50000,
"prompt_tokens": 30000,
"completion_tokens": 20000,
"total_cost_usd": 0.15,
"count": 100
},
"byPeriod": [
{ "period": "2026-01-15", "total_tokens": 5000, "count": 10 }
],
"byDomain": [
{ "domain": "example.com", "total_tokens": 25000, "count": 50 }
]
}
Activity data
The caller's own activity
| Endpoint | Returns |
|---|---|
GET /activity | Timeline. Query: limit, start_date, end_date, metric_type |
GET /activity/stats | Event counts by type and by domain |
GET /activity/recent | The most recent events, limit defaults to 50 |
GET /activity/analytics | Time series. Query: period (day, week, month, year), start_date, end_date |
curl 'https://api.appilot.space/activity/analytics?period=day' \
-H 'Authorization: Bearer <token>'
{
"success": true,
"period": "day",
"data": {
"metrics": [
{ "date": "2026-01-15", "hour": 10, "xAxisKey": 10, "conversations": 5, "actions": 2 }
],
"summary": {
"period": "day",
"totalPoints": 24,
"totalConversations": 120,
"totalActions": 48,
"avgConversations": 5.0,
"avgActions": 2.0
}
},
"count": 24
}
The two series are conversations (assistant_query) and actions (action_executed).
Organization activity
GET /activity/organization, /activity/organization/stats, /activity/organization/recent and /activity/organization/assistant-queries return what other members did, so they require the org admin role. A member without it gets 403 with code ORG_ADMIN_REQUIRED. A valid token is not a tenancy check.
/activity/organization accepts limit, start_date, end_date, metric_type, app_id and domain. /activity/organization/assistant-queries accepts limit, offset and has_actions, and is the endpoint behind the question list in the Backoffice.
What activity does not contain
This measures Appilot, not browsing. Appilot records what a user does with the assistant and nothing about where they go otherwise, so there is no visited-page series to return. page_visit, search_performed, form_interaction and domain_visit were retired in September 2026 and are refused at ingest with 410 and code ACTIVITY_TYPE_RETIRED. Historical rows keep those values and still render. See Privacy.
Knowledge gaps
There is no coverage-scoring endpoint. Where the knowledge base falls short is read from two places instead: GET /knowledge/requests lists the gaps users flagged themselves (see the Knowledge API), and GET /activity/organization/assistant-queries lists what was actually asked, so an unanswered topic shows up as a cluster of questions with no matching article.