Expand description
ccstats is a local-first library and CLI for token and cost analytics from
Claude Code, OpenAI Codex, Cursor, and Grok session logs.
The public SDK entry points are summarize_cost for explicit options and
summarize_cost_with_cli_config for CLI-aligned config defaults. The binary
target calls run_cli to preserve the existing command-line behavior.
Structs§
- Cost
Summary - Structured usage and cost summary for SDK consumers.
- Model
Cost Summary - Per-model usage and cost summary.
- Summary
Options - Options for
summarize_cost. - Token
Breakdown - Token totals for a summary or model row.
Enums§
- SdkError
- Errors returned by the public SDK API.
- Usage
Range - Date range to summarize.
- Usage
Source - Supported local usage sources.
Functions§
- run_cli
- Run the
ccstatsCLI using process arguments. - summarize_
cost - Summarize local token usage and estimated cost.
- summarize_
cost_ with_ cli_ config - Summarize local token usage using the same reusable config defaults as the CLI.