---
title: "Token Breakdown"
method: GET
path: "/observability/token-breakdown"
---

# Token Breakdown

`GET /observability/token-breakdown`

## Request

- Base URL: `http://127.0.0.1:8052`
- URL: `http://127.0.0.1:8052/observability/token-breakdown`
- Auth: none declared

Return per-session token consumption breakdown.

For each agent session with a ``.tokens`` sidecar file, breaks down
token usage into estimated categories:

- ``system_prompt_estimated``: overhead from Bernstein role templates
- ``task_description_estimated``: tokens for the task title + description
- ``context_estimated``: remaining input tokens (context files, tool results,
  prior conversation history, etc.)
- ``output_tokens``: actual assistant output tokens

Also reports ``optimization_opportunities`` - a list of human-readable
insights when a category accounts for an unusually large share of tokens
(e.g. "context files are 60% of input").

Token sidecar files live at ``.sdd/runtime/{session_id}.tokens``.
Breakdown percentages use a 4-chars/token heuristic for size estimates.

Returns:
    Dict with ``sessions`` list and aggregate ``summary``.

## Response `200`

Successful Response

- object

---

[API](https://skmtc.dev/bernstein/apis/bernstein-task-server.md) · [All operations](https://skmtc.dev/bernstein/apis/bernstein-task-server/llms.txt) · [OpenAPI document](https://skmtc.dev/bernstein/apis/bernstein-task-server/revisions/2a20a34ad2eb?raw)
