---
title: "List charges or runs"
method: GET
path: "/analytics/activity"
tags: ["Analytics"]
---

# List charges or runs

`GET /analytics/activity`

## Request

- Base URL: `https://api.varg.ai/v2`
- URL: `https://api.varg.ai/v2/analytics/activity`
- Auth: HTTP bearer

The ledger charges behind the numbers (`group=charge`), or those charges grouped by run (`group=run`) with each run's lifetime total alongside. Cursor-paginated: pass `next_cursor` as `cursor`.

All analytics endpoints return `{ "data": ..., "meta": ... }`. `meta` carries the resolved range
(`from` inclusive, `to` exclusive, ISO 8601 UTC), `timezone`, the comparison period, applied `filters`,
`data_as_of`, `money_unit`, `time_basis` and `attribution_scope`.

Amounts are whole credits; fields ending in `_cents` are credits (1 credit = 1 cent). Charges are counted
when they were posted to the ledger. On team accounts, non-members only see their own identity
dimensions (`attribution_scope: self`); others collapse into "Other ..." groups.

With `format=csv` the response is `text/csv`; exports are capped at 10,000 rows and fail with 400 `export_too_large` instead of truncating.

## Query parameters

- `from` string
- `to` string
- `timezone` string
- `compare` 'previous_period' | 'none'
- `compare_from` string
- `compare_to` string
- `tool` string
- `model` string
- `workspace_id` string
- `api_key_id` string
- `member_id` string
- `creator` string
- `source` string
- `status` string
- `group` 'charge' | 'run'
- `sort` 'recent' | 'amount'
- `limit` integer
- `cursor` string
- `format` 'json' | 'csv'

## Response `200`

Result envelope (JSON) or CSV export

- AnalyticsActivityResponse
  - `data` AnalyticsActivity, required
    - `group` 'charge' | 'run', required
    - `items` union[], required: Charges when `group` is `charge`, runs when `group` is `run`.
      - union
        - AnalyticsChargeItem
          - `id` string: Ledger charge id.
          - `posted_at` string, date-time
          - `amount_cents` integer
          - `billed_units` object, nullable
          - `job_id` string, nullable
          - `run_id` string, nullable
          - `tool` AnalyticsDimensionValue: A dimension value with its display label.
            - `key` string, required: Value key, or the special keys `none`, `hidden`, `other`.
            - `label` string, required
            - `kind` 'member' | 'api_key': Creators only.
            - `avatar_url` string, nullable
            - `owner_label` string, nullable: Creator keys only; the person the key belongs to.
            - `revoked` boolean: API keys only; revoked keys keep their history.
            - `deleted` boolean: Folders only; the folder was deleted after the charge.
          - `model` AnalyticsDimensionValue: A dimension value with its display label.
            - `key` string, required: Value key, or the special keys `none`, `hidden`, `other`.
            - `label` string, required
            - `kind` 'member' | 'api_key': Creators only.
            - `avatar_url` string, nullable
            - `owner_label` string, nullable: Creator keys only; the person the key belongs to.
            - `revoked` boolean: API keys only; revoked keys keep their history.
            - `deleted` boolean: Folders only; the folder was deleted after the charge.
          - `status` AnalyticsDimensionValue: A dimension value with its display label.
            - `key` string, required: Value key, or the special keys `none`, `hidden`, `other`.
            - `label` string, required
            - `kind` 'member' | 'api_key': Creators only.
            - `avatar_url` string, nullable
            - `owner_label` string, nullable: Creator keys only; the person the key belongs to.
            - `revoked` boolean: API keys only; revoked keys keep their history.
            - `deleted` boolean: Folders only; the folder was deleted after the charge.
          - `source` AnalyticsDimensionValue: A dimension value with its display label.
            - `key` string, required: Value key, or the special keys `none`, `hidden`, `other`.
            - `label` string, required
            - `kind` 'member' | 'api_key': Creators only.
            - `avatar_url` string, nullable
            - `owner_label` string, nullable: Creator keys only; the person the key belongs to.
            - `revoked` boolean: API keys only; revoked keys keep their history.
            - `deleted` boolean: Folders only; the folder was deleted after the charge.
          - `workspace` AnalyticsDimensionValue: A dimension value with its display label.
            - `key` string, required: Value key, or the special keys `none`, `hidden`, `other`.
            - `label` string, required
            - `kind` 'member' | 'api_key': Creators only.
            - `avatar_url` string, nullable
            - `owner_label` string, nullable: Creator keys only; the person the key belongs to.
            - `revoked` boolean: API keys only; revoked keys keep their history.
            - `deleted` boolean: Folders only; the folder was deleted after the charge.
          - `api_key` AnalyticsDimensionValue: A dimension value with its display label.
            - `key` string, required: Value key, or the special keys `none`, `hidden`, `other`.
            - `label` string, required
            - `kind` 'member' | 'api_key': Creators only.
            - `avatar_url` string, nullable
            - `owner_label` string, nullable: Creator keys only; the person the key belongs to.
            - `revoked` boolean: API keys only; revoked keys keep their history.
            - `deleted` boolean: Folders only; the folder was deleted after the charge.
          - `member` AnalyticsDimensionValue: A dimension value with its display label.
            - `key` string, required: Value key, or the special keys `none`, `hidden`, `other`.
            - `label` string, required
            - `kind` 'member' | 'api_key': Creators only.
            - `avatar_url` string, nullable
            - `owner_label` string, nullable: Creator keys only; the person the key belongs to.
            - `revoked` boolean: API keys only; revoked keys keep their history.
            - `deleted` boolean: Folders only; the folder was deleted after the charge.
        - AnalyticsRunItem
          - `run_id` string
          - `spend_in_range_cents` integer: The run's charges that fall in the range and match the filters.
          - `run_total_charged_cents` integer: Everything the run was ever charged, regardless of range and filters.
          - `charges_in_range` integer
          - `first_posted_at` string, date-time
          - `last_posted_at` string, date-time
          - `root` object: The run's top-level job.
            - `tool` AnalyticsDimensionValue: A dimension value with its display label.
              - …
            - `model` AnalyticsDimensionValue: A dimension value with its display label.
              - …
            - `status` AnalyticsDimensionValue: A dimension value with its display label.
              - …
            - `created_at` string, date-time, nullable
          - `source` AnalyticsDimensionValue: A dimension value with its display label.
            - `key` string, required: Value key, or the special keys `none`, `hidden`, `other`.
            - `label` string, required
            - `kind` 'member' | 'api_key': Creators only.
            - `avatar_url` string, nullable
            - `owner_label` string, nullable: Creator keys only; the person the key belongs to.
            - `revoked` boolean: API keys only; revoked keys keep their history.
            - `deleted` boolean: Folders only; the folder was deleted after the charge.
          - `member` AnalyticsDimensionValue: A dimension value with its display label.
            - `key` string, required: Value key, or the special keys `none`, `hidden`, `other`.
            - `label` string, required
            - `kind` 'member' | 'api_key': Creators only.
            - `avatar_url` string, nullable
            - `owner_label` string, nullable: Creator keys only; the person the key belongs to.
            - `revoked` boolean: API keys only; revoked keys keep their history.
            - `deleted` boolean: Folders only; the folder was deleted after the charge.
          - `api_key` AnalyticsDimensionValue: A dimension value with its display label.
            - `key` string, required: Value key, or the special keys `none`, `hidden`, `other`.
            - `label` string, required
            - `kind` 'member' | 'api_key': Creators only.
            - `avatar_url` string, nullable
            - `owner_label` string, nullable: Creator keys only; the person the key belongs to.
            - `revoked` boolean: API keys only; revoked keys keep their history.
            - `deleted` boolean: Folders only; the folder was deleted after the charge.
    - `next_cursor` string, nullable, required: Pass as `cursor` for the next page; null on the last page.
    - `total` object, required: Totals over the whole range, not just this page.
      - `count` integer
      - `spend_cents` integer
  - `meta` AnalyticsMeta, required: Metadata describing how the numbers were computed.
    - `definition_version` string, required: Changes whenever a metric's meaning changes.
    - `from` string, date-time: Resolved range start (inclusive).
    - `to` string, date-time: Resolved range end (exclusive).
    - `timezone` string
    - `compare` object, nullable: The comparison period, or null when none.
      - `from` string, date-time
      - `to` string, date-time
    - `filters` object: Filters applied, keyed by query parameter name.
    - `data_as_of` string, date-time, required
    - `money_unit` 'cent', required: Amounts are whole credits, in fields ending in `_cents`.
    - `time_basis` 'posted_at' | 'lifetime' | 'created_at', required: `posted_at` = when the ledger charge was posted; `created_at` = when a file was made.
    - `attribution_scope` 'full' | 'self', required: `self` means identity dimensions show only the caller's own values.

## Other responses

- `400`: Invalid parameter (code `invalid_request`, `invalid_range`, `range_too_large`, `invalid_timezone`, `invalid_filter`, `unsupported_group_by`, ...)
- `401`: Missing or invalid API key / JWT
- `503`: Analytics is temporarily unavailable (`analytics_unavailable`)

## Changes

- **2026-10-20** `43bcf5ea398d`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/varg/apis/varg-api/changes/analytics/activity/get.md)

---

[API](https://skmtc.dev/varg/apis/varg-api.md) · [All operations](https://skmtc.dev/varg/apis/varg-api/llms.txt) · [OpenAPI document](https://skmtc.dev/varg/apis/varg-api/revisions/09d49a6d852f?raw)
