See exactly where your OpenCode tokens and money go.
OpenCode Usage turns your OpenCode spending into a clean, visual dashboard: token volume, cache hit rate, and cost at a glance, with drill-downs by model and by any time range — from months down to individual minutes.
- Clear overview — record count, total tokens, and total cost in cards right at the top
- Cache insights — cache hit rate on every bar, plus an overlay line
- Full time control — view by month, week, day, hour, or minute, and filter by model
- Always current — incremental updates fetch only what's new, and auto-update keeps the dashboard fresh even while you're away
- Two ways to view — tokens or cost, light or dark theme, English or Chinese
cd opencode_usage
pip install -r requirements.txt
python opencode_usage.pyYour browser opens automatically at http://127.0.0.1:9901.
From the dashboard you can:
- Click Update to refresh your usage data
- Open Settings to choose your login (GitHub or Google), time range, and update interval
- Enable Auto Update to keep data fresh on a schedule, even when the page is closed
To scrape data from the command line instead, run python scrape_usage.py --help.
Released under the MIT License.
