Analytics
Read usage and spend per agent, user and team, plus balance and plan usage.
With the analytics:read scope a key can read the same numbers the usage screens in the app show. All of it is read-only.
The person behind the key decides what is visible. On the workspace-wide endpoints a workspace admin sees the whole workspace, a team manager sees their own teams, and a member is refused with 403. Create analytics keys as a workspace admin.
Workspace summary
curl "$AGENTWORKS_API_URL/insights/summary?period=30d" \
-H "Authorization: Bearer $AGENTWORKS_API_KEY"
period is today, 7d, 30d, 90d or month. The summary has run totals and success rate, runs per day, active agents and users, messages, cost in euros, the saving from prompt caching, and the most used models.
Per agent, per user, per team
| Endpoint | Returns |
|---|---|
GET /admin/agents/stats?days=30 | Per agent: runs, success rate, cost and tokens. |
GET /admin/agents/usage-by-user?days=30 | Per user: runs and cost, split by agent. |
GET /admin/agents/usage-by-team?days=30 | Per team: runs and cost, split by agent. |
days is between 7 and 90.
Spend
| Endpoint | Returns |
|---|---|
GET /admin/wallet/org/spend-by-agent | Spend per agent. |
GET /admin/wallet/org/spend-by-model | Spend per model. |
GET /admin/wallet/org/spend-by-team | Spend per team. |
GET /admin/wallet/org/spend-by-user | Spend per user. |
GET /admin/wallet/org/spend-over-time | Spend over time. |
GET /admin/wallet/team-stats | Usage grouped by member, agent, team or day. |
Balance and plan
| Endpoint | Returns |
|---|---|
GET /wallet | The workspace balance. |
GET /wallet/my-usage | Usage of the person behind the key. |
GET /wallet/monthly-statement | The monthly statement. |
GET /settings/entitlements | What the plan includes and how much is used. |
GET /dashboard/stats | The headline numbers of the dashboard. |
Workflows
Workflow numbers come with workflows:read: GET /workflows/run-usage for the monthly workflow-run usage and GET /workflows/{workflow_id}/runs/summary for one workflow.
Good to know
- These endpoints have their own lower rate limits (10 to 30 requests per minute). Cache the result on your side; the numbers do not change by the second.
- Exact response fields are in the API reference tab.