usagestat-alpha is a scriptable CLI tool designed to track AI provider quotas, token usage, and costs through a local dashboard and HTTP API. It enables users to monitor and analyze consumption patterns across multiple AI services.
Key Features:
Use JavaScript plugins to gather detailed statistics from over 100 AI providers including Claude, OpenAI, Azure, Deepseek, and more.
Visualize data in real time via an interactive local dashboard with optional background daemon support.
Export metrics as JSON or CSV for custom reporting and integration.
Track usage patterns across multiple accounts and projects with granular insights into token consumption.
Connect to T3 Code through a built-in CLIProxyAPI bridge for enhanced workflow automation.
Target Audience and Benefits:
Ideal for developers, data analysts, and AI researchers who need to manage costs and optimize resource allocation. The tool provides practical insights into usage patterns, helping users stay within budget while improving collaboration through smooth integration with existing workflows.
The application is available via the Windows Package Manager, making it easy to install or deploy using the winget command line.
README
usagestat
Track AI provider quotas, token usage, and costs through a scriptable CLI,
a local dashboard, and an HTTP API.
Probe provider accounts through JavaScript plugins and export JSON or CSV.
Keep usage available in a local dashboard with an optional background daemon.
Connect to T3 Code → Usage → Limits through the built-in CLIProxyAPI bridge.
Install both usagestat and usagestatd, plus bundled provider plugins, from
your preferred package channel.
Install
The stable backend is v2.0.2 for Linux
x64/ARM64 (glibc 2.39+). Its release qualification record
tracks publication and checks; package feeds can lag the GitHub release.
It updates provider compatibility, Codex accounting and OpenCode 2 storage,
and adds three opt-in providers with dashboard setup guidance. Independent
dashboard settings and RPM service updates remain available. /v1/providers,
/v1/usage and optional SDK run ingestion keep their existing contracts.
AgenticDriver consumers should read the migration notes before configuring
capture or account quotas.
Try v2.0.0-alpha.4 on Windows, macOS or Linux. The unsigned
backend alpha includes native archives and a Windows per-user installer. Native
bar frontends, desktop acceptance and signing remain pending. Stable package-manager instructions follow below.
Separate alpha packages and installation instructions
are available through Fedora COPR, the Ubuntu PPA, AUR, Homebrew (including macOS),
Scoop and npm. Chocolatey and WinGet await upstream review; all WinGet automated
checks passed.
The linked guide tracks
each channel's actual availability.
Choose a package manager already available on your system. Published packages
and stable release downloads target Linux; the stable Homebrew formula is also
Linux-only. See the v2.0.2 publication record
for current versions and feed publication status.
For direct downloads, source builds, upgrades, and removal, see the
installation guide.
First run
usagestat --version
usagestat list
usagestat config validate
You should see the installed version, discovered providers, and configuration
validation results. Provider access is separate from installation: sign into
its supported CLI/app or configure its credentials before probing. For example:
usagestat usage claude
usagestat --json usage claude
To include a provider in regular polling, add it to
~/.config/usagestat/config.toml (or the corresponding XDG config directory):
[[providers]]
id = "claude"
enabled = true
On Linux with a systemd user session, start the dashboard and enable startup at
login:
usagestat daemon enable
usagestat daemon status
usagestat dashboard
The dashboard is at . Use
usagestat dashboard --url to print its link over SSH. Without systemd, run
usagestatd in a terminal and open that URL while it is running. CLI probes work
without starting the daemon.
Connect T3 Code
usagestat daemon t3 auto
usagestat daemon key
With the daemon running, add http://127.0.0.1:6736 as a CLIProxyAPI hub in T3
Code and paste the printed management key. T3 mode is remembered across daemon
stops and restarts. usagestat daemon t3 off disables the bridge;
usagestat daemon disable stops the daemon and turns off autostart.
See the T3 Code setup guide for supported quotas and details.
Providers and configuration
Plugins are discovered from:
USAGESTAT_PLUGIN_DIR
~/.config/usagestat/plugins
Installed share/usagestat/plugins and lib/usagestat/plugins under the binary prefix
The released v2.0.0 and v2.0.1 packages contain 97 providers. v2.0.2 adds
three opt-in web providers: Muse (muse.ai, separate from Muse Code), LithosAI
and WorkBuddy. These and the 20 providers added in v2.0.0 are disabled by
default; enable only the ones you use. See the
provider compatibility reference for supported
data sources and validation coverage.
Configure the new providers under dashboard Settings → Collection. Each
uses its own saved session cookie header. LithosAI requires both
__Host-console_session and __Host-console_csrf from the same console session;
the native host attaches the CSRF header only on its permitted console routes.
WorkBuddy also requires the full Browser User-Agent from the browser that
supplied the cookies, exposed under its provider-specific settings. Automatic
browser import and WorkBuddy desktop credential decryption are not implemented.
The new paths are covered by synthetic fixtures; live credentials remain
unqualified. TypeSafe's Cloudflare protection remains a limitation, reported
as an unavailable measurement rather than an expired login or zero usage.
OpenCode Go reads the current credential table in a selected OpenCode 2 database
and deduplicates migrated history. A present empty table means logout; its old
imported auth.json is not reused. Set databasePath for a preview channel or
additional source to keep credentials and history on that selected database.
usagestat --json list includes provider-owned UI metadata. Icon paths are
resolved to absolute SVG paths; icon.path is the monochrome/default icon and
icon.colorPath is present only when a separate color SVG is available.
Shared artwork comes from @agenticdriver/provider-icons, pinned and vendored
under plugins/_provider-icons; custom provider icons still take precedence.
Run node tools/provider-icons.mjs --check to verify the selected assets.
Configuration paths and advanced example
Default config path:
~/.config/usagestat/config.toml
Default cache path:
~/.local/share/usagestat/snapshots.json
An advanced example with separate accounts and sources (mock requires the
dev-only plugins described below):
cargo run -p usagestat-cli -- --config ./config.toml --plugin-dir ./plugins list
cargo run -p usagestat-daemon -- --config ./config.toml --refresh-sec 30
Dashboard and history
The dedicated History tab is included in v2.0.0. History adds provider/date filters, daily/weekly/monthly
charts, previous-period comparisons, and CSV export of saved daily reports.
Quota-only providers retain their snapshot charts. See
CLI and dashboard documentation.
The dashboard also has Used/Remaining quotas, month-to-date and all-time
history ranges, daily ledger rows, partial/unpriced cost indicators, and portable
display preferences. Saved daily usage is available through JSON cost reports
and /v1/history/daily// (month, all, or a day count).
/metrics exports provider health and quota gauges for Prometheus without
credential or account labels. See history accounting
for source precedence, model estimates, cache savings, and pricing coverage.
The v2.0.1 dashboard's Settings tab separates Display preferences from
shared backend Collection setup. Display includes visibility, names, ordering,
trackers, provider logo variants, monochrome/colour, themes, thresholds and layout.
Collection configures polling, provider sources and write-only credentials after
unlocking with the private local setup key. Display stays independent of UsageStat
Bar. Charts offer hover, focus and tap details for recorded quotas, tokens and costs.
Upgrade the daemon to v2.0.1 to receive these settings; existing v2.0.0 binaries
and tags are unchanged.
See dashboard settings and
automatic service updates.
Development
Build and install a separate dev profile with a current stable Rust toolchain
and the source-build prerequisites:
scripts/install-dev.sh
usagestat-dev --version
usagestat-dev daemon enable uses the separate usagestat-dev.service and dev
config/data directories.
This starts from CrossUsage's architecture, but uses separate project names and
contracts:
A copyable plugin template lives at templates/provider-plugin. It includes
examples for api, oauth, local, cli, and web source modes. Dev-only
example providers live under templates/dev-providers and are not loaded or
packaged as production providers.