Skip to content

Commit 1153dcc

Browse files
committed
docs(session): document model breakdowns for claude session --id
Describe the table and JSON shape of `ccusage claude session --id` now that it shares the session table and emits `modelBreakdowns`, and note that its breakdown entries mark unpriced models.
1 parent 9f9ac56 commit 1153dcc

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

‎docs/guide/json-output.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ ccusage daily --json | jq '.totals.unpricedModels // []'
5858

5959
Detection follows the [cost mode](/guide/cost-modes): an entry counts as unpriced only when ccusage had to calculate its cost from tokens and found no price. In `display` mode, or in `auto` mode for an entry that carries its own stored cost, nothing is looked up, so nothing is reported. A model can therefore appear in `unpricedModels` and still show a positive cost when some of its entries carried stored costs. An absent key means no unpriced usage was detected under the selected mode, not that every price is current.
6060

61-
Covered: `daily`, `weekly`, `monthly`, and `session` reports for every agent, including `--instances`, `--sections`, and `--by-agent`. Focused `codex` reports set `missingPricing` on the affected entries of each period's `models` map. Not covered: `blocks` and `session --id`, which have no `totals` object.
61+
Covered: `daily`, `weekly`, `monthly`, and `session` reports for every agent, including `--instances`, `--sections`, and `--by-agent`. Focused `codex` reports set `missingPricing` on the affected entries of each period's `models` map. `blocks` and `session --id` have no `totals` object; Claude's `session --id` still marks unpriced entries of its `modelBreakdowns`.
6262

6363
Update ccusage, or run without `--offline`, once the pricing source lists the model.
6464

‎docs/guide/session-reports.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ This is particularly useful for:
3434
# Get session data in table format
3535
ccusage claude session --id session-abc123-def456
3636

37+
# Add per-model rows to the session table
38+
ccusage claude session --id session-abc123-def456 --breakdown
39+
3740
# Get session data as JSON for scripting
3841
ccusage codex session --id codex://threads/01a0bb8c-c7c0-7630-9d82-860b875930f0 --json
3942

@@ -45,6 +48,8 @@ COST=$(ccusage claude session --id "$SESSION_ID" --json | jq '.totalCost')
4548
echo "Current session: \$${COST}"
4649
```
4750

51+
The table shows the same columns as `ccusage claude session`, restricted to that one session, and `--breakdown` adds a row per model. Claude's JSON output keeps `sessionId`, `totalCost`, `totalTokens`, and the per-request `entries`, and also carries the session's `modelsUsed` and per-model `modelBreakdowns`.
52+
4853
### Session ID Format
4954

5055
For Claude Code, session IDs are the actual filenames (without `.jsonl` extension) stored in Claude data directories. They typically look like:

0 commit comments

Comments
 (0)