# GET /v1/sessions/{session_id}/context-report - Latest context breakdown

Source: <https://everruns.com/docs/api/operations/get_session_context_report/>

GET

/v1/sessions/{session\_id}/context-report

Select code samplecURL (shell:curl)

```js
const url = 'https://app.everruns.com/api/v1/sessions/example/context-report';
const options = {method: 'GET'};


try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```sh
curl --request GET \
  --url https://app.everruns.com/api/v1/sessions/example/context-report
```

* Production APIapp.everruns.com/api/v1/sessions/{session\_id}/context-report

## Parameters

### Path Parameters

**session\_id**

required

string

Session ID (prefixed, e.g., session\_…)

## Responses

### 200

Session context report

Media typeapplication/json

Token-budget report for a session — a model-aware breakdown of the context window into named sections plus per-source contributions, so callers can answer “what’s filling the context?” without reverse- engineering the prompt assembly.

object

**context\_window\_tokens**

Total context window size in tokens for `model`. `None` if the model’s profile lacks limits data.

integer | null format: int32

**contributions**

required

Per-source token contributions (per-tool, per-capability, per-message) for attribution.

Array\<object>

Single-source token contribution within a `ContextReportSection` — the per-tool / per-capability / per-message attribution that lets operators see which source is eating the context window.

object

**label**

required

Human-readable label suitable for UI display.

string

**section\_key**

required

Section this contribution rolls up into; matches `ContextReportSection.key`.

string

**source\_id**

required

Stable id of the contributing source (capability id, tool name, message id, etc.).

string

**tokens**

required

Tokens this single source contributes to the assembled context.

integer format: int32

**cumulative\_usage**

One of:

* object

  Cumulative LLM usage observed across the session so far (token + cost rollup).

  object

  **actual\_cost\_usd**

  Actual cost of this generation in USD, as reported by the provider inline (e.g. OpenRouter’s `usage.cost`, which reflects real post-routing/BYOK/cache pricing). `None` for providers that do not return a cost.

  number | null format: double

  **cache\_creation\_tokens**

  Number of tokens written to cache, disjoint from `input_tokens`

  integer | null format: int32

  **cache\_read\_tokens**

  Number of tokens read from cache (reduces cost), disjoint from `input_tokens`

  integer | null format: int32

  **effective\_cost\_usd**

  Best-effort USD cost when it cannot be derived from actual/estimated alone: already-aggregated usage, or a generation carrying a cost that belongs to neither slot. Per-generation usage normally leaves this unset and derives the effective cost from actual-else-estimated; the exception is a turn whose compaction cost is folded in, where the combined total has to live here precisely so the generation’s own actual-vs-estimated distinction survives (EVE-895).

  number | null format: double

  **estimated\_cost\_usd**

  Estimated cost of this generation in USD, derived from the model’s static price-table profile. Computed whenever a profile with cost data exists, independently of `actual_cost_usd`, so estimate-vs-actual drift can be reconciled. `None` when there is no profile cost data for the model.

  number | null format: double

  **input\_tokens**

  required

  Number of non-cached prompt tokens (cached reads/writes are tracked separately; see the disjoint bucket convention on the struct)

  integer format: int32

  **output\_tokens**

  required

  Number of output/completion tokens

  integer format: int32

* null

  null

**estimated\_input\_tokens**

required

Estimated number of input tokens consumed by the next generation given the current context.

integer format: int32

**model**

required

Model identifier the report’s token estimates target (used to scope context-window math).

string

**sections**

required

Logical sections of the assembled context (system prompt, tool defs, message history, etc.) for inspection.

Array\<object>

One logical section of the assembled LLM context (system prompt, tool definitions, message history, etc.) with its rolled-up token budget.

object

**items**

required

Number of items this section comprises (messages, tool defs, etc.).

integer format: int32

**key**

required

Stable section key (e.g. `system_prompt`, `tools`, `history`). Used as a join key for contributions.

string

**label**

required

Human-readable section label suitable for UI display.

string

**tokens**

required

Total tokens this section contributes to the assembled context.

integer format: int32

**session\_id**

required

Prefixed session identifier this report describes.

string

##### Examplegenerated

```json
{
  "context_window_tokens": 1,
  "contributions": [
    {
      "label": "example",
      "section_key": "example",
      "source_id": "example",
      "tokens": 1
    }
  ],
  "cumulative_usage": {
    "actual_cost_usd": 1,
    "cache_creation_tokens": 1,
    "cache_read_tokens": 1,
    "effective_cost_usd": 1,
    "estimated_cost_usd": 1,
    "input_tokens": 1,
    "output_tokens": 1
  },
  "estimated_input_tokens": 1,
  "model": "example",
  "sections": [
    {
      "items": 1,
      "key": "example",
      "label": "example",
      "tokens": 1
    }
  ],
  "session_id": "example"
}
```

### 400

Invalid session ID

### 404

Session not found

### 500

Internal server error