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

EndpointReturns
GET /admin/agents/stats?days=30Per agent: runs, success rate, cost and tokens.
GET /admin/agents/usage-by-user?days=30Per user: runs and cost, split by agent.
GET /admin/agents/usage-by-team?days=30Per team: runs and cost, split by agent.

days is between 7 and 90.

Spend

EndpointReturns
GET /admin/wallet/org/spend-by-agentSpend per agent.
GET /admin/wallet/org/spend-by-modelSpend per model.
GET /admin/wallet/org/spend-by-teamSpend per team.
GET /admin/wallet/org/spend-by-userSpend per user.
GET /admin/wallet/org/spend-over-timeSpend over time.
GET /admin/wallet/team-statsUsage grouped by member, agent, team or day.

Balance and plan

EndpointReturns
GET /walletThe workspace balance.
GET /wallet/my-usageUsage of the person behind the key.
GET /wallet/monthly-statementThe monthly statement.
GET /settings/entitlementsWhat the plan includes and how much is used.
GET /dashboard/statsThe 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.