Skip to main content

Crate ccstats

Crate ccstats 

Source
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§

CostSummary
Structured usage and cost summary for SDK consumers.
ModelCostSummary
Per-model usage and cost summary.
SummaryOptions
Options for summarize_cost.
TokenBreakdown
Token totals for a summary or model row.

Enums§

SdkError
Errors returned by the public SDK API.
UsageRange
Date range to summarize.
UsageSource
Supported local usage sources.

Functions§

run_cli
Run the ccstats CLI 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.