Skip to content

Latest context breakdown

GET
/v1/sessions/{session_id}/context-report
curl --request GET \
--url https://app.everruns.com/api/v1/sessions/example/context-report
session_id
required
string

Session ID (prefixed, e.g., session_…)

Session context report

Media type application/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:
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
Example generated
{
"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,
"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"
}

Invalid session ID

Session not found

Internal server error