---
title: "Sum agent token usage per raw phase across merged Trails in a window"
method: GET
path: "/api/v1/insights/{forge}/{project}/trail-activity-summary"
tags: ["Insights"]
---

# Sum agent token usage per raw phase across merged Trails in a window

`GET /api/v1/insights/{forge}/{project}/trail-activity-summary`

## Request

- Base URL: `https://entire.io` (the document declares no server; this is the origin it was published from)
- URL: `https://entire.io/api/v1/insights/{forge}/{project}/trail-activity-summary`
- Auth: none declared

## Path parameters

- `forge` 'gh' | 'et', required
- `project` string, required

## Query parameters

- `repo_id` string, required
- `since` string, date-time
- `until` string, date-time

## Response `200`

Phase totals; trails_with_phases counts Trails with any phase row, including zero-token ones. Phase names are raw and may grow.

- object
  - `trails_with_phases` integer, required
  - `phases` object[], required
    - `phase` string, required
    - `tokens` object, required
      - `fresh_input` integer, required
      - `cache_read` integer, required
      - `cache_write_5m` integer, required
      - `cache_write_1h` integer, required
      - `output` integer, required
  - `development` object
    - `tokens` integer, required
  - `review` object
    - `tokens` integer, required

## Other responses

- `400`: Invalid request
- `401`: Not authenticated
- `403`: Feature disabled, or the upstream's problem+json for a caller without access to the project
- `404`: Project not found, or the upstream plugin-not-installed problem+json (https://entire.io/errors/insights/plugin-not-installed)
- `422`: Invalid project name
- `500`: Insights service error (upstream problem+json passed through)
- `502`: Insights service unavailable
- `503`: Insights service unavailable (upstream problem+json passed through)

## Changes

- **2026-11-02** `d09ae166aae2`: 1 warning
  - changed the pattern of the `query` request parameter `repo_id` from `^(?:repo_)?[0-7][0-9A-HJKMNP-TV-Z]{25}$` to `^repo_[0-7][0-9A-HJKMNP-TV-Z]{25}$`
- **2026-10-29** `ad35574a59f1`: 1 warning
  - changed the pattern of the `query` request parameter `repo_id` from `^[0-7][0-9A-HJKMNP-TV-Z]{25}$` to `^(?:repo_)?[0-7][0-9A-HJKMNP-TV-Z]{25}$`
- **2026-10-23** `11b1a41f3508`: 2 info
  - added the optional property `development` to the response with the `200` status
  - added the optional property `review` to the response with the `200` status
- **2026-10-21** `27e0d9846622`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/entire/apis/entire-api/changes/api/v1/insights/:forge/:project/trail-activity-summary/get.md)

---

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