# What Claude Code was used for, by kind of activity

> Activity is what Claude Code and Cowork reported about themselves, kept as daily totals: names, counts and durations, never the text of a prompt, a response or a command. sections has one entry per kind of activity over the range, with its largest rows. response_times estimates, per model, how long a request took and how long its first token took: the times are kept in buckets, so each figure can be off by the width of one. people says how many people each kind of activity reached, and names nobody.

Source: https://docs.levelfour.ai/api-reference/anthropic/get-providers-anthropic-activity


## GET /api/v1/providers/anthropic/activity

Activity is what Claude Code and Cowork reported about themselves, kept as daily totals: names, counts and durations, never the text of a prompt, a response or a command. sections has one entry per kind of activity over the range, with its largest rows. response_times estimates, per model, how long a request took and how long its first token took: the times are kept in buckets, so each figure can be off by the width of one. people says how many people each kind of activity reached, and names nobody.

### Authentication

Send `Authorization: Bearer <token>`.

### Parameters

- `start` (query, string, required): First day, ISO 8601 (YYYY-MM-DD or a datetime)
- `end` (query, string, required): Last day, ISO 8601 (YYYY-MM-DD or a datetime), included

### Responses

#### 200: Successful Response

- `success` (boolean, default `true`)
- `data` (object, required)
  - `sections` (array of object, required): One entry per measure, in a fixed order, including a measure nothing was counted for
    - `events` (integer, required): How often it happened. For active_time and lines it is the number of reports received, each covering some seconds or lines: read their amount
    - `amount` (number, required): What the measure adds up besides a count: milliseconds for tool and mcp_connected, seconds for active_time, characters for prompt, lines for lines, USD of usage value for request_source and repository, and 0 for a measure that only counts
    - `measure` (string, required): The kind of activity, such as tool, plugin or session
    - `items` (array of object, required): The 200 largest rows of the measure, largest first: by amount for request_source and repository, by events for every other measure
      - `events` (integer, required): How often it happened. For active_time and lines it is the number of reports received, each covering some seconds or lines: read their amount
      - `amount` (number, required): What the measure adds up besides a count: milliseconds for tool and mcp_connected, seconds for active_time, characters for prompt, lines for lines, USD of usage value for request_source and repository, and 0 for a measure that only counts
      - `key` (string, required): What was counted, such as a tool, a plugin or a language
      - `detail` (string, required): What tells rows of one key apart, such as an outcome or a version
    - `more` (object, required): Every row past the 200 listed, added up
      - `events` (integer, required): How often it happened. For active_time and lines it is the number of reports received, each covering some seconds or lines: read their amount
      - `amount` (number, required): What the measure adds up besides a count: milliseconds for tool and mcp_connected, seconds for active_time, characters for prompt, lines for lines, USD of usage value for request_source and repository, and 0 for a measure that only counts
  - `response_times` (array of object, required): One entry per model that was timed, the model with the most requests first, at most 50
    - `model` (string, required): The model, or (other) for times the intake could not keep under a model
    - `requests` (integer, required): Requests that said how long they took
    - `first_token_p50_ms` (integer, nullable, required): Estimated median time to the first token, in ms. Null when no request said it, as with requests that were not streamed
    - `first_token_p90_ms` (integer, nullable, required): Estimated time to the first token that 9 in 10 requests stayed under, in ms. Null as the median is
    - `total_p50_ms` (integer, nullable, required): Estimated median time of a whole request, in ms. Null for the model (other)
    - `total_p90_ms` (integer, nullable, required): Estimated time of a whole request that 9 in 10 requests stayed under, in ms. Null as the median is
  - `people` (object, required): How many people each kind of activity reached, each person counted once
    - `sessions` (integer, required): People who started a session
    - `active_time` (integer, required): People with active time
    - `prompts` (integer, required): People who sent a prompt
    - `api_errors` (integer, required): People who had a model request fail
    - `lines` (integer, required): People for whom Claude Code added or removed lines of code
    - `git_output` (integer, required): People for whom Claude Code made a commit or opened a pull request
- `timestamp` (string, required)

#### Errors

- `400`: Bad Request
- `401`: Authentication Error
- `403`: Authorization Error
- `404`: Not Found
- `409`: Conflict
- `422`: Validation Error
- `429`: Rate Limit Exceeded
- `500`: Internal Server Error

Body of `400`, `401`, `403`, `404`, `409`, `422`, `429`, `500`:

- `success` (`false`, required)
- `error` (object, required)
  - `code` (string, required)
  - `message` (string, required)
  - `details` (any)
- `timestamp` (date-time string, required)
