codex-cost
codex-cost is a local web dashboard for inspecting Codex token usage from session logs on your machine.
It scans the local Codex data directory, summarizes token totals, and serves a browser dashboard with:
- all-time, today, and last-seven-days token totals
- project, model, thread, effort, and context-window distributions
- draggable timeline filtering
- hover tooltips with exact chart values
- a detailed usage event table
The first release is offline and read-only. It does not call OpenAI APIs.
Install
From this repository:
After publishing to crates.io:
Run
Use the default Codex home:
Or pass an explicit Codex data directory:
On Windows PowerShell:
codex-cost --codex-home "$env:USERPROFILE\.codex" --listen 127.0.0.1:4317
Open the printed local URL in a browser.
Data Source
The dashboard reads:
~/.codex/sessions/**/*.jsonl~/.codex/archived_sessions/*.jsonl
Token totals are computed from last_token_usage.total_tokens in Codex token_count events to avoid double-counting cumulative session totals.
Development
License
MIT