Skip to main content
The Activity API surfaces session and prompt telemetry for your account and organization. Use it to track usage, monitor costs, generate reports, and understand how your team is using Runtime. For the full endpoint specifications, see the Activity reference pages.

When to use this

  • You want to track how many sessions and prompts your team runs per day
  • You need to monitor LLM spend for budgeting or cost alerts
  • You are building an internal dashboard that surfaces Runtime usage data
  • You want to generate weekly or monthly usage digests

Prerequisites

  • An API key with activity:read scope
  • For team-level data: an organization-scoped key

Personal activity (daily heatmap)

GET /sessions/telemetry/activity returns daily counts of sessions, prompts, and costs for the authenticated user. The data is suitable for rendering a GitHub-style contribution heatmap.
Pass X-Organization-Id to scope results to a specific organization. Without it, the response covers personal sessions only.

Personal summary

GET /sessions/telemetry/summary returns aggregate totals for a time period - total sessions, total prompts, total cost, and averages:

Recent prompts

GET /sessions/telemetry/recent-prompts returns the most recent prompts across all sessions, with their status, cost, model, and timing:
This is useful for debugging - quickly see what prompts ran, which ones failed, and how much they cost.

Per-session usage

GET /sessions/{id}/telemetry/usage returns detailed usage for a specific session - prompt count, total cost, token usage, and per-prompt breakdown:

Team-level telemetry

Organization-scoped keys unlock team-wide endpoints. These require the activity:read scope and an org-scoped key (or X-Organization-Id header).

Team member breakdown

See which team members are most active and where spend is concentrated:
Python

Team traces

Traces give you prompt-level detail including tool calls, token usage, and timing. Useful for auditing what agents are doing:

Patterns for monitoring

Daily cost alerting

Poll the summary endpoint daily and alert when spend exceeds a threshold:
Python

Weekly digest

Combine team/summary and team/members to build a weekly digest:
Python

Next steps

Personal Activity reference

Full endpoint spec for personal daily activity.

Team Summary reference

Aggregate org-wide telemetry.

Best practices

Cost controls, scope hygiene, and lifecycle patterns.

Webhooks and triggers

Get notified when prompts complete instead of polling.