session
View a Claude Code or Codex session turn by turn to see model, effort, token counts, and cost per response. Accepts a full session id or unique prefix.
Instructions
One session turn by turn: model, effort, token counts and cost per model response. Accepts a full session id or a unique prefix. Never returns prompt text, tool output, or command lines; the database does not hold them.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | full session id or a unique prefix | |
| currency | No | override the detected plan: "usd" or "share" |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| usd | Yes | ||
| plan | Yes | "api" or "subscription", re-detected on every scan | |
| turns | Yes | ||
| source | Yes | ||
| project | Yes | ||
| currency | Yes | "usd" when the figures were charged, "list_price_equivalent" when a subscription covered them and the figures are what the usage would have cost on the API | |
| ended_at | Yes | ||
| subagents | Yes | the sub-agent runs this session launched; empty for a session that launched none | |
| agent_type | No | ||
| scan_error | No | why the most recent scan attempt failed, in which case the figures are from the last successful scan | |
| started_at | Yes | ||
| tool_calls | Yes | ||
| turn_count | Yes | length of turns, so a caller can size the session without walking it | |
| age_seconds | Yes | seconds since that scan; the server rescans when a tool is called more than 60 seconds after the last attempt, or on refresh | |
| ingested_at | Yes | RFC 3339 time of the last successful transcript scan; empty if none has succeeded yet | |
| plan_reason | Yes | why that plan was chosen | |
| tool_errors | Yes | tool results the harness marked as errors | |
| parent_session_id | No | set when this is itself a sub-agent run |