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

# Get Token Breakdown

`GET /costs/token-breakdown`

Per-agent session token consumption breakdown.

For each agent session shows where the context budget was spent:
system prompt (Bernstein overhead), context files, task description,
tool call results accumulated at runtime, and assistant output.

Identifies optimization opportunities - e.g. if 60% of tokens are
context files the agent never used.

Args:
    request: FastAPI request.
    session_id: If provided, return breakdown for a single session only.

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

## Query parameters

- `session_id` string, nullable

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/sipyourdrink-ltd/apis/bernstein-task-server.md) · [All operations](https://skmtc.net/sipyourdrink-ltd/apis/bernstein-task-server/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/sipyourdrink-ltd/bernstein-task-server/versions/86f514b4e920/schema)
