Something went wrong. Try again.
npx ccusage
Something went wrong. Try again.
README.md
ccusage-adapter-codex #
The Codex adapter: it turns Codex session JSONL, including forked and replayed sessions into the usage entries the reports render.
Owns #
aggregate.rs— grouping events into report periods, including cross-session dedupe.loader.rs— reading the source, dedupe, and date filtering.parser.rs— raw record parsing, token mapping, and model naming.paths.rs— environment variables, default directories, and file discovery.replay.rs— detecting history that a forked or subagent session replays.report.rs— the JSON and table shapes where they differ from the shared ones.speed.rs— resolving the service tier that priced each request.types.rs— types that stay inside this adapter.
Anything that is not specific to this source belongs in ccusage-core or
ccusage-adapter-common instead.
Data source #
~/.codex/sessions/**/*.jsonl
Record shapes, token mapping, and cost rules are documented in src/README.md.
Reads plain files through ccusage-adapter-common, which handles walking, size-balanced
chunking, and ordered parallel reads.
Public surface #
aggregate::aggregate_eventsaggregate::filter_events_by_dateaggregate::load_groupsloader::load_codex_eventsloader::load_codex_events_from_directoryreport::calculate_codex_model_costreport::calculate_group_costreport::codex_model_missing_pricingreport::non_cached_input_tokensspeed::CodexSpeedPolicyspeed::resolve_codex_speedtypes::CodexGrouptypes::CodexModelUsagetypes::CodexRawUsagetypes::CodexServiceTiertypes::CodexTokenUsageEventtypes::CodexUsageBuckettypes::merge_codex_service_tiersrunreport_json
Depends on #
ccusage-adapter-commonccusage-corecompact_strjiffmemchrrustc-hashserdeserde_json
Build layer #
Built in the adapters Crane artifact layer; the layer compiles all adapters in one Cargo invocation, so they build concurrently.