Beyond the Usage Bar: Estimating Codex Tokens with ccusage

OpenAI's subscription dashboard only shows a percentage bar—no token counts or spend. Here's a practical setup to approximate daily and monthly usage with ccusage.

Published
Updated
Reading time
6 minutes
Tags
  • AI workflow
  • Developer productivity
  • Productivity tooling

OpenAI's subscription dashboard shows a tidy usage bar with a percentage—but it won't tell you how many tokens you actually sent, or what that translates to in spend. For anyone running Codex-heavy sessions day after day, that's a visibility gap. This note walks through the setup I use to get approximate daily and monthly numbers with ccusage.

Why I needed more than the percentage bar

The dashboard is reassuring when you just want to know you haven't burned through your allowance, but it doesn't help with:

  • Budgeting and forecasting: knowing whether this month looks heavier than last month.
  • Per-project breakdowns: seeing which repositories or tasks drive most usage.
  • Understanding patterns: spotting which days are Codex-heavy versus manual-heavy.

I wanted a CLI that could read my local logs and surface basic analytics without uploading data anywhere. That's where ccusage fits in.

What ccusage actually does

ccusage is a privacy-focused CLI that reads JSONL logs and turns them into tables or JSON output. It's not an official billing tool, so the cost numbers are estimates based on model pricing—close enough for planning, but not a substitute for your actual invoice.

The package I use is @ccusage/codex, which is tailored for Codex logs. It runs locally, nothing leaves your machine.

Installation on WSL

My setup lives in WSL, so steps are straightforward:

  1. Start WSL and confirm you're in the right shell.
  2. Check Node version with node -v—anything reasonably recent works.
  3. Install globally with npm i -g @ccusage/codex.

After that, the ccusage-codex command is available anywhere.

Daily and monthly views

For day-to-day checks, I run:

ccusage-codex daily

This shows a clean table with token counts, cache reads, reasoning tokens, and an estimated cost for the current day.

For month-over-month summaries, I use the latest version via npx to avoid worrying about version drift:

npx @ccusage/codex@latest monthly

Sample output

Here's what monthly view looks like across a few months. Scroll horizontally to view the full table:

┌──────────┬──────────────────────────────────────────────────────────────────────────────┬──────────────┬─────────────┬─────────────┬────────────────┬────────────────┬─────────────�?�?Month    �?Models                                                                       �?       Input �?     Output �?  Reasoning �?    Cache Read �?  Total Tokens �? Cost (USD) �?├──────────┼──────────────────────────────────────────────────────────────────────────────┼──────────────┼─────────────┼─────────────┼────────────────┼────────────────┼─────────────�?�?Nov 2025 �?- gpt-5 (fallback)                                                           �?  42,481,412 �?  6,513,939 �?  3,721,112 �?   599,235,584 �?   648,230,935 �?    $193.15 �?�?         �?- gpt-5-codex                                                                �?             �?            �?            �?               �?               �?            �?�?         �?- gpt-5.1                                                                    �?             �?            �?            �?               �?               �?            �?�?         �?- gpt-5.1-codex                                                              �?             �?            �?            �?               �?               �?            �?�?         �?- gpt-5.1-codex-max                                                          �?             �?            �?            �?               �?               �?            �?├──────────┼──────────────────────────────────────────────────────────────────────────────┼──────────────┼─────────────┼─────────────┼────────────────┼────────────────┼─────────────�?�?Dec 2025 �?- gpt-5 (fallback)                                                           �?  80,588,823 �? 17,188,254 �? 12,464,088 �? 1,268,957,056 �? 1,366,734,133 �?    $563.02 �?�?         �?- gpt-5.1-codex                                                              �?             �?            �?            �?               �?               �?            �?�?         �?- gpt-5.1-codex-max                                                          �?             �?            �?            �?               �?               �?            �?�?         �?- gpt-5.2                                                                    �?             �?            �?            �?               �?               �?            �?�?         �?- gpt-5.2-codex                                                              �?             �?            �?               �?               �?            �?├──────────┼──────────────────────────────────────────────────────────────────────────────┼──────────────┼─────────────┼─────────────┼────────────────┼────────────────┼─────────────�?�?Jan 2026 �?- gpt-5 (fallback)                                                           �?  24,301,712 �?  6,781,770 �?  5,006,316 �?   484,759,936 �?   515,843,418 �?    $185.55 �?�?         �?- gpt-5.1-codex-max                                                          �?             �?            �?            �?               �?               �?            �?�?         �?- gpt-5.2                                                                    �?             �?            �?            �?               �?               �?            �?�?         �?- gpt-5.2-codex                                                              �?             �?            �?               �?               �?            �?├──────────┼──────────────────────────────────────────────────────────────────────────────┼──────────────┼─────────────┼─────────────┼────────────────┼────────────────┼─────────────�?�?Total    �?                                                                             �? 147,371,947 �? 30,483,963 �? 21,191,516 �? 2,352,952,576 �? 2,530,808,486 �?    $941.71 �?└──────────┴──────────────────────────────────────────────────────────────────────────────┴──────────────┴─────────────┴─────────────┴────────────────┴────────────────┴─────────────�?/code>

How I use the numbers

Most days I glance at the daily view to check whether current work is drifting toward a heavier pattern. Monthly runs help me:

  • Validate pacing: See if the current week is on track versus previous months.
  • Flag outliers: Spot months with reasoning or cache read spikes that might indicate repeated refinements or re-runs.
  • Rough budgeting: Get a sense of what a “typical�?month costs before seeing the actual bill.

Limitations to keep in mind

These numbers are useful for planning, but they have caveats:

  • Not official: The cost column is an estimate based on model pricing. Your actual invoice may differ.
  • Local only: If you use Codex from multiple machines or sessions, each one needs its own run.
  • Subscription-specific: Pricing tiers change, so ccusage estimates are tied to the current rate card.

Wrap-up

Having a quick way to turn vague percentage bars into concrete token counts and rough cost estimates helps me stay intentional about when I lean on Codex. It's not a replacement for the official dashboard, but it fills the visibility gap that the percentage bar leaves open. If you're in the same boat—seeing the bar move but not knowing what it means—ccusage is a lightweight, privacy-preserving step toward clarity.

If you've got your own setup for tracking usage, or if you spot a better alternative, I'd like to hear about it. Drop a note via the contact page or share a link in the repo issues.