Sandbox
@janekbaraniewski/openusage

Terminal usage dashboard for AI coding tools

OpenUsage shows live quota, usage, spend, resets, rate limits, and model data for multiple AI tools in one local terminal view. It auto-detects supported providers, can keep collecting data in the background, and can also print daily, weekly, monthly, session, and block reports for scripts or CI.

192 stars19 forksGoUpdated 7d ago
Who it's for

Builders who want one local view of usage across Claude Code, Codex, Cursor, Copilot, Gemini CLI, and OpenRouter.

What it delivers

You can see which tool, model, or session is driving cost without checking each provider separately.

What it does

Cross-provider dashboard

Tracks usage and spend across 36 providers, including coding agents, API platforms, and local runtimes.

Zero-config auto-detection

Finds supported tools and API key environment variables on your machine without a setup file.

Headless reports

Outputs daily, weekly, monthly, session, and billing-block reports, including JSON for scripts and CI.

tmux status bar integration

Shows the active tool’s cost, quota, burn rate, and logo in your tmux status bar.

Claude Code statusline

Adds session cost, daily cost, burn rate, and context usage to the Claude Code status bar.

Background telemetry daemon

Collects usage continuously into a local SQLite database even when the dashboard is closed.

Tool integrations

Supports hooks and status-line bridges for Claude Code, Codex CLI, OpenCode, and Antigravity.

Export and metrics

Exports snapshots to JSON or CSV, looks up pricing, and can serve Prometheus metrics from the built-in hub.

How to get it

  1. 1Run
    brew install janekbaraniewski/tap/openusage
  2. 2Run
    curl -fsSL https://github.com/janekbaraniewski/openusage/releases/latest/download/install.sh | bash
  3. 3Run
    go install github.com/janekbaraniewski/openusage/cmd/openusage@latest

README

OpenUsage logo

OpenUsage.sh: terminal-first local quota and usage tracking for Claude Code, Codex CLI, Cursor, Copilot, and OpenRouter.

Install · Providers · Config · Keybindings · Development


OpenUsage is the terminal-first local dashboard published at openusage.sh. Publicly, the clearest brand reference is OpenUsage.sh. It auto-detects AI coding tools and API keys on your workstation and shows live quota, usage, spend, resets, rate limits, and model data in your terminal. It is built for mixed-tool workflows across Claude Code, Codex CLI, Cursor, Copilot, Gemini CLI, OpenRouter, OpenAI, Anthropic, and more. Zero config required — just run openusage.

OpenUsage dashboard

Run it side-by-side with your coding agent:

OpenUsage side by side
OpenUsage running alongside OpenCode monitoring live OpenRouter usage.

Install

macOS (Homebrew, recommended)

brew install janekbaraniewski/tap/openusage

All platforms (quick install script)

curl -fsSL https://github.com/janekbaraniewski/openusage/releases/latest/download/install.sh | bash

From source (Go 1.25+)

go install github.com/janekbaraniewski/openusage/cmd/openusage@latest

Requires CGO (CGO_ENABLED=1). Pre-built binaries are also available on the Releases page.

Run

openusage

Auto-detection picks up local tools and common API key env vars. No config needed.

Command-line reports & statusline

Besides the live dashboard, OpenUsage has headless subcommands that reuse the same parsing and pricing — handy for scripts, CI, and quick checks:

openusage daily                # usage & cost by day (also: weekly, monthly)
openusage session              # grouped by session
openusage blocks               # by 5-hour billing block, with burn rate + projection
openusage daily --json         # machine-readable output for scripts/CI
openusage statusline install   # one-line status bar for Claude Code

What each report can show, by provider:

ReportProviders
daily / weekly / monthlyevery provider that reports cost or tokens
session / blocksClaude Code, Codex, Gemini CLI, Copilot, Cursor, OpenCode, Ollama, Amp, Codebuff, OpenClaw, Roo Code, Kilo Code, Crush, Goose, Hermes, Zed, Droid, Kiro
statuslineClaude Code

Remote API platforms (OpenAI, Anthropic, OpenRouter, …) appear in the periodic reports only — they expose no per-turn data. See the headless reports & statusline guide for the full matrix and flags.

Add to tmux

Show your Claude Code, Codex, Cursor, Copilot, and OpenRouter usage — cost, quota, burn rate, and the active tool — right in your tmux status bar. It tracks whichever tool you're actively using and renders its real, brand-colored logo.

OpenUsage in the tmux status bar

One command to set it up. Tweak the layout and segments live, then reload:

openusage tmux install                         # interactive setup
tmux source-file ~/.config/tmux/tmux.conf      # reload

Installing the OpenUsage tmux status segment

Want real provider logos instead of emoji? The installer can drop in a bundled icon font and wire up your terminal. See provider icons.

openusage tmux install --write                 # non-interactive (scripting): just write the snippet
openusage tmux --preset claude-focused         # preview other presets (12 built-in)
openusage tmux font setup                       # configure icons for kitty/Ghostty/WezTerm
openusage tmux doctor                          # diagnose if something is off

See the tmux integration guide for the format grammar, theming, the icon font, and watch-mode alerts.

Claude Code statusline

Your cost, burn rate, how much of the 5-hour limit you've used, and how full the context window is. Right in the Claude Code status bar:

OpenUsage statusline in Claude Code

Same deal as tmux: one command, pick your segments, apply.

openusage statusline install

Installing the Claude Code statusline

Restart Claude Code and it's there.

See the statusline guide for customization and manual setup.

Track coding agent usage across multiple platforms

Native dashboards show one provider at a time. OpenUsage gives you one local-first view across coding agents, API platforms, and local runtimes so you can answer:

  • Which tool or provider is burning budget?
  • Which model caused the spike?
  • Which quota or reset is getting close?
  • Which sessions, projects, or MCP tools drove the change?

It is built for end-user tool tracking, not for instrumenting a separate AI app with tracing SDKs or a billing backend.

If you want the full positioning argument, read the guide: best way to track coding agent usage and quotas across providers.

If the question is whether this is the right fit versus a simpler local limits tracker, use:

Features

  • Cross-provider tracking — compare coding agents, API platforms, and local runtimes in one local dashboard
  • 36 providers — coding agents and CLIs (Claude Code, Codex, Cursor, Copilot, Gemini CLI, Antigravity CLI, OpenCode, Amp, Goose, Roo Code, Kilo Code, Kiro, Zed, and more), API platforms (OpenAI, Anthropic, OpenRouter, Groq, Mistral, DeepSeek, Moonshot, Perplexity, xAI, Z.AI, and more), and local runtimes (Ollama)
  • Zero config — auto-detects your AI tools and API keys, just run it
  • Live dashboard — see spend, quotas, rate limits, tokens, burn rate, and per-model usage at a glance
  • tmux integration — show the active tool's usage in your tmux status bar, with provider icons, presets, and active-tool detection
  • Claude Code statusline — one-line session cost, today's cost, burn rate, and context usage in Claude Code
  • Headless reportsdaily, weekly, monthly, session, and blocks reports in table or JSON
  • Background tracking — a daemon collects data continuously, even when the dashboard is closed, into a local SQLite database you own
  • Deep cost insights — model, tool, project, MCP, and session breakdowns; combine providers like OpenCode + OpenRouter
  • Tool integrations — optional hooks/status-line bridges for Claude Code, Codex CLI, OpenCode, and Antigravity provide richer, real-time usage data
  • Export & metrics — export snapshots to JSON or CSV, look up model pricing, or serve Prometheus metrics from the built-in hub
  • Customizable — 17 built-in themes, adjustable time windows, configurable thresholds, provider reordering, plus external theme files

Supported providers

36 provider integrations covering coding agents, CLIs, IDE tools, API platforms, and local runtimes. See docs/providers.md for all providers with detailed descriptions and screenshots.

Claude Code

Detection: claude binary + ~/.claude directory

Tracks daily activity, per-model token usage, 5-hour billing block computation, burn rate, and cost estimation.

Claude Code provider

OpenRouter

Detection: OPENROUTER_API_KEY environment variable

Tracks credits, activity, generation stats, and per-model breakdown across multiple API endpoints.

OpenRouter provider

All providers

Coding agents & IDEs

ProviderDetectionWhat it tracks
Claude Codeclaude binary + ~/.claudeDaily activity, per-model tokens, billing blocks, burn rate
Cursorcursor binary + local SQLite DBsPlan spend & limits, per-model aggregation, Composer sessions
GitHub Copilotgh CLI + Copilot extensionChat & completions quota, org billing, session tracking
Codex CLIcodex binary + ~/.codexSession tokens, per-model breakdown, credits, rate limits
Gemini CLIgemini binary + ~/.geminiOAuth status, conversation count, per-model tokens
Antigravity CLIagy binary + ~/.gemini/antigravity-cliStatus-line context, session tokens, model quotas
OpenCodeOPENCODE_API_KEY / ZEN_API_KEYCredits, activity, generation stats
OllamaOLLAMA_HOST / binaryLocal models, per-model usage

API platforms

ProviderDetectionWhat it tracks
OpenAIOPENAI_API_KEYRate limits via header probing
AnthropicANTHROPIC_API_KEYRate limits via header probing
Azure OpenAIAZURE_OPENAI_API_KEY + AZURE_OPENAI_ENDPOINTRate limits via header probing on the resource endpoint
OpenRouterOPENROUTER_API_KEYCredits, activity, per-model breakdown
GroqGROQ_API_KEYRate limits, daily usage windows
Mistral AIMISTRAL_API_KEYSubscription, usage endpoints
DeepSeekDEEPSEEK_API_KEYRate limits, account balance
Moonshot (Kimi)MOONSHOT_API_KEYBalance breakdown (cash + voucher), org limits, tier; supports api.moonshot.ai (default) and api.moonshot.cn
PerplexityBrowser session at console.perplexity.aiTier, balance, lifetime spend, auto-reload, 30d usage analytics
OpenCode (Zen + Console)OPENCODE_API_KEY / ZEN_API_KEY + browser session at opencode.aiZen models (API key) + balance, monthly limit/usage, subscription, payment method (cookie)
xAI (Grok)XAI_API_KEYRate limits, API key info
Z.AI Coding PlanZAI_API_KEY / ZHIPUAI_API_KEYCoding plan quotas, model/tool usage, daily trends
Google Gemini APIGEMINI_API_KEY / GOOGLE_API_KEYRate limits, model limits
Alibaba CloudALIBABA_CLOUD_API_KEYQuotas, credits, per-model tracking

Configuration

No config file needed — auto-detection handles everything. Override or extend via:

  • macOS/Linux: ~/.config/openusage/settings.json
  • Windows: %APPDATA%\openusage\settings.json
{
  "auto_detect": true,
  "ui": { "refresh_interval_seconds": 30 },
  "accounts": [
    {
      "id": "openai-personal",
      "provider": "openai",
      "api_key_env": "OPENAI_API_KEY",
      "probe_model": "gpt-4.1-mini"
    }
  ]
}

Full reference: configs/example_settings.json

External themes

You can define custom themes as JSON files loaded at startup from:

  • ~/.config/openusage/themes/*.json (macOS/Linux)
  • %APPDATA%\\openusage\\themes\\*.json (Windows)
  • Any extra directory in OPENUSAGE_THEME_DIR (path-list separated)

Theme files use the same color token fields as built-ins. Browse the bundled examples for reference shapes — every shipped theme lives at internal/tui/bundled_themes/.

Daemon

Background data collection, even when the dashboard isn't open:

openusage telemetry daemon                # Run in foreground
openusage telemetry daemon install        # Install as system service (launchd / systemd)
openusage telemetry daemon status         # Check status
openusage telemetry daemon uninstall      # Uninstall

Installed services snapshot the provider env vars currently set in your shell. If you change API key env vars later, rerun openusage telemetry daemon install to refresh the service environment.

Manage tool integrations:

openusage integrations list [--all]       # List integration statuses
openusage integrations install <id>       # Install hook/plugin
openusage integrations uninstall <id>     # Remove

Keybindings

KeyAction
TabSwitch views
j / k, Up / DownMove cursor
h / l, Left / RightNavigate panels
Enter / EscOpen detail / back
PgUp / PgDnScroll tile
[ ]Switch detail tabs
rRefresh all
/Filter providers
tCycle theme
wCycle time window
cCycle cost visibility for focused tile (auto → hide → show → auto, persists per-account)
,Open settings
Shift+J / Shift+KReorder providers
?Help
qQuit

Development

make build    # Build binary to ./bin/openusage
make test     # Run tests with -race and coverage
make lint     # golangci-lint
make run      # go run cmd/openusage/main.go
make demo     # Preview with simulated data (no API keys needed)

Debug mode: OPENUSAGE_DEBUG=1 openusage

License

MIT

Files in the repo

Repository payload31 top-level entries
  • .claude
  • .codex
  • .cursor
  • .github
  • .opencode
  • assets
  • cmd
  • configs
  • docs
  • internal
  • scripts
  • website
  • .dockerignore
  • .gitignore
  • .golangci.yaml
  • .goreleaser.yaml
  • .release-please-manifest.json
  • AGENTS.md
  • CHANGELOG.md
  • CLAUDE.md
  • CODE_OF_CONDUCT.md
  • CODEX.md
  • CONTRIBUTING.md
  • Dockerfile.hub
  • go.mod
  • go.sum
  • LICENSE
  • Makefile
  • README.md
  • release-please-config.json
  • SECURITY.md

Discussion (0)

Ask about usage, or say what you built with it

Sign in to join the discussion.

No comments yet. Be the first to say what this is good for.

More tools

JuliusBrussee/
caveman

🪨 why use many token when few token do trick — Claude Code skill that cuts 65% of tokens by talking like caveman

105k
1 add
MemPalace/
mempalace

The best-benchmarked open-source AI memory system. And it's free.

59k
stablyai/
orca

Orca is the ADE for working with a fleet of parallel agents. Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.

66k

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

132k

Never stop coding. Free MIT AI gateway: one endpoint, 352 providers (150+ free), 1200+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 550+ contributors

64k
headroomlabs-ai/
headroom

Compress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.

71k