Optimize

Paste the JSON output of ccusage to reprice your coding-agent usage at today's Token Barometer prices, compare it with subscription plans and pay-as-you-go API, estimate how often a 5-hour window would hit its limit, and see what cheaper models would cost. Everything runs in your browser. Nothing is uploaded or stored.

1. Input

Run these in a terminal and paste both outputs. monthly gives per-model totals; blocks gives 5-hour windows for wall risk. Optional range filter: --since YYYYMMDD --until YYYYMMDD.

npx ccusage@latest monthly --json --breakdown --by-agent
npx ccusage@latest blocks --json

Processed in your browser. Nothing is uploaded.

Method

Each model name is mapped to a registry model (exact id, alias table, provider prefix and date suffix removed, dot and dash spellings, then a flagged fuzzy match). Tokens are priced at that model's standard per-million prices: input, output, cache write and cache read, using the vendor-direct price when one exists and the cheapest host otherwise. If the registry has no cache price, cache write is assumed at 1.25 times and cache read at 0.10 times the input price, and the row is labelled assumed. Long-context and batch tiers are not used.

The ccusage cost is shown next to the repriced cost. ccusage uses its own price snapshot, so a difference above 15 percent is flagged rather than hidden.

Plan prices are list prices checked on 2026-10-04. Plan capacity is an estimate and is shown only where a source supports it; otherwise it reads capacity unknown. Wall risk compares your 5-hour block spend, at API prices, with a plan's window capacity when that is known. Model substitution is price only and says nothing about quality. Known limits: web chat usage is not in agent logs, there are no live quota meters, ccusage output can change between versions, and plans can change limits without notice.

Plan sources

FAQ

What is ccusage?

ccusage is an open-source command line tool that reads the local logs of coding agents (Claude Code, Codex, Gemini CLI, OpenCode and others) and prints token counts and costs as a table or JSON. This page reads that JSON. It is not affiliated with ccusage.

What data leaves my browser?

None. The text you paste is parsed and priced in your browser. The page only downloads the public price list (GET /api/v1/optimizer/prices), the same data the rest of the site serves. A permalink stores your usage in the URL fragment after the #, which browsers never send to a server.

Why are plan capacities estimates, or unknown?

Providers publish plan limits as multiples of a base plan per 5-hour and weekly window, not as tokens or dollars. A capacity figure is shown only when it has a source; otherwise the tier reads capacity unknown. The API bills exactly, a plan stops you when a window is exhausted.

Why does my ccusage cost differ from the repriced total?

ccusage prices tokens with its own price snapshot, and offline mode can be stale. This page reprices at the current Token Barometer prices. When the two differ by more than 15 percent, both are shown with a note.

Which agents and models are covered?

Any agent that ccusage can read, as long as the model name maps to a registry model. Claude, GPT and Gemini model names map automatically. Unmapped names are listed and never priced at zero; you can pick a registry model for them. Web chat usage is not in agent logs and is not included.

How do I add a missing model?

Pick the closest registry model in the unmapped panel for this session. To fix the mapping for everyone, report the model name on the issues page linked in the footer, or add it to src/data/optimizer/model-aliases.json.