Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenCode Usage

OpenCode Usage

See exactly where your OpenCode tokens and money go.

Python 3.11+ Chart.js 4.4 Playwright


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.

OpenCode Usage

Features

  • 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

Quick Start

cd opencode_usage
pip install -r requirements.txt
python opencode_usage.py

Your browser opens automatically at http://127.0.0.1:9901.

Usage

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.

License

Released under the MIT License.

About

Know exactly where your OpenCode tokens and money go. A clean dashboard shows token usage, cost, and cache hit rate at a glance — drill down by model or any time window, down to the minute. Data stays fresh with auto-updates. One command and you're done.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages