TUI dashboard for AI provider token usage — live progress bars in your terminal.
──────────────────────────────────────────────────────────────────────────
◈ TokenGauge [q] quit
──────────────────────────────────────────────────────────────────────────
╭────────────────────────────────────────────────────────────────────────╮
│ OpenRouter — $0.79 remaining │
│ Used ██████████████████████████████████████░░ 9.21/10 │
╰────────────────────────────────────────────────────────────────────────╯
╭────────────────────────────────────────────────────────────────────────╮
│ ChatGPT Plus/Pro — prolite │
│ 5h window █░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 3% · ~19min │
│ Weekly ████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 8% · ~1d │
│ GPT-5.3-Codex-Spark ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0% · ~5h │
│ Credits: None │
╰────────────────────────────────────────────────────────────────────────╯
╭────────────────────────────────────────────────────────────────────────╮
│ OpenCode Go │
│ 5h window ███████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 17% · ~5h │
│ Weekly ███░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 7% · ~6d │
│ Monthly ████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 9% · ~15d │
╰────────────────────────────────────────────────────────────────────────╯
──────────────────────────────────────────────────────────────────────────
Updated 12:57:30 PM Next in 18s [r] reload [m] manage
──────────────────────────────────────────────────────────────────────────
npx tsx src/index.ts| Argument | Description |
|---|---|
--auth-path / -p |
Custom path to OpenCode auth.json |
| Key | Action |
|---|---|
q / Ctrl+C |
Quit |
r |
Refresh now |
Connect from the manage screen with the headless OAuth flow, or import OpenCode's openai OAuth entry from ~/.local/share/opencode/auth.json. This uses ChatGPT's https://chatgpt.com/backend-api/wham/usage endpoint and can show 5h/weekly subscription windows.
If OpenCode has an API-key entry, or if you manually configure one later, TokenGauge keeps it separate from ChatGPT Plus/Pro. Normal OpenAI API keys do not expose ChatGPT subscription quota, so this currently shows a configured-placeholder until organization/admin usage support is added.
Choose Claude / Anthropic in the connect menu to import OpenCode's anthropic OAuth entry from ~/.local/share/opencode/auth.json, or use Manage → Import from OpenCode. TokenGauge calls GET https://api.anthropic.com/api/oauth/usage with Authorization: Bearer <access> and anthropic-beta: oauth-2025-04-20, then displays Claude usage windows such as 5h, weekly, Opus/Sonnet, and extra usage when present. Normal Anthropic API keys are not Claude subscription OAuth credentials and only show a limited placeholder.
Configure OpenCode Black from the manage screen with your session cookie, or set OPENCODE_COOKIE. See Cookie-based providers for how to get your cookie. Optional workspace override: OPENCODE_WORKSPACE_ID or CODEXBAR_OPENCODE_WORKSPACE_ID.
Configure OpenCode Go from the manage screen with your session cookie, or set OPENCODE_GO_COOKIE. If unset, it falls back to OPENCODE_COOKIE. See Cookie-based providers for how to get your cookie. Optional workspace override: OPENCODE_GO_WORKSPACE_ID or CODEXBAR_OPENCODEGO_WORKSPACE_ID.
Configure DeepSeek from the manage screen with your API key, or set DEEPSEEK_API_KEY.
Configure Venice from the manage screen with your API key, or set VENICE_API_KEY.
Configure Moonshot from the manage screen with your API key, or set MOONSHOT_API_KEY.
Configure Crof from the manage screen with your API key, or set CROF_API_KEY.
Configure Warp from the manage screen with your API key, or set WARP_API_KEY.
Configure Copilot from the manage screen with your GitHub token, or set COPILOT_TOKEN.
Configure Synthetic from the manage screen with your API key, or set SYNTHETIC_API_KEY.
Configure Codebuff from the manage screen with your API key, or set CODEBUFF_API_KEY. Optional base URL override: CODEBUFF_API_URL.
Configure z.ai from the manage screen with your API key, or set ZAI_API_KEY. Optional host override: Z_AI_API_HOST.
Configure Perplexity from the manage screen with your API key. Perplexity does not currently expose account usage or billing credits through a public API endpoint, so TokenGauge only confirms the key is configured.
Configure Manus from the manage screen with your session token, or set MANUS_TOKEN. Use the Authorization Bearer token from your browser's network requests to manus.im.
Configure Doubao from the manage screen with your API key, or set DOUBAO_API_KEY.
Configure Kilo from the manage screen with your API key, or set KILO_API_KEY.
Configure MiniMax from the manage screen with your API key, or set MINIMAX_API_KEY.
Configure Ollama from the manage screen with your session cookie, or set OLLAMA_COOKIE. See Cookie-based providers for how to get your cookie.
Some providers require a session cookie instead of an API key. To get your cookie:
- Open your browser's Developer Tools (F12)
- Go to the Network tab
- Sign in to the provider's website and navigate to the usage/settings page
- Find any request to the provider's domain (e.g.,
opencode.ai,ollama.com) - Right-click the request → Copy → Copy as cURL (bash)
- Paste the copied command and extract the
Cookie:header value - In TokenGauge, select the provider and paste the cookie header when prompted
Alternatively, you can use browser extensions like EditThisCookie to copy the cookie header directly.
Implement the Provider interface in src/providers/types.ts:
interface Provider {
readonly id: string;
readonly displayName: string;
fetchUsage(): Promise<ProviderUsage>;
}Register it in src/index.ts and it renders alongside the rest.
Uses only Node built-ins (https, fs, os, readline, process). Dev toolchain: tsx, typescript.