Skip to content

khnfrhn/tokenbar

Repository files navigation

TokenBar 🎚️

Universal API Usage Tracker for Windows β€” Monitor rate limits across all your AI providers.

License: MIT Platform: Windows

Inspired by CodexBar by @steipete β€” the macOS-only original. TokenBar brings the same functionality to Windows users.

Why TokenBar?

If you're vibe-coding with Claude Code, Cursor, or other AI tools, you need to know:

  • How much of your 5-hour session limit is left?
  • How much of your weekly limit is remaining?
  • When does each window reset?

CodexBar solves this beautifully on macOS. TokenBar brings it to Windows.

Screenshots

Main view (light) Main view (dark)

Settings (light) Settings (dark)

Supported Providers

Provider Status What's Tracked
🧠 Anthropic (Claude) βœ… Input/output tokens, requests
πŸ€– OpenAI (ChatGPT) βœ… Tokens per minute, requests, billing
πŸ”Š ElevenLabs βœ… Character usage, voices
πŸš€ Groq πŸ”œ Coming soon
πŸ–ΌοΈ Stability AI πŸ”œ Coming soon
β™Š Google AI (Gemini) πŸ”œ Coming soon

Features

Current (v0.2)

  • βœ… System tray icon with quick access
  • βœ… Multi-provider support (Anthropic, OpenAI, ElevenLabs)
  • βœ… Real-time rate limit tracking via API headers
  • βœ… Secure credential storage (Windows Credential Manager)
  • βœ… Auto-refresh every 5 minutes
  • βœ… Click to expand provider details

Planned (v0.3+)

  • Desktop notifications at 80%/95% usage
  • Usage history graphs
  • Cost tracking and estimates
  • More providers (Groq, Stability, Google, Replicate)

Tech Stack

  • Frontend: React + TypeScript + Tailwind CSS
  • Backend: Rust (Tauri)
  • Build: Tauri bundler (creates small Windows executables)

Data Sources

  1. Local stats: ~/.claude/stats-cache.json (always available)
  2. OAuth API: GET https://api.anthropic.com/api/oauth/usage (when credentials available)
  3. CLI fallback: Parse claude /usage output (if needed)

Installation

From Releases

Download the latest .msi or .exe from Releases.

Build from Source

# Prerequisites: Node.js 18+, Rust 1.70+
git clone https://github.com/khnfrhn/tokenbar.git
cd tokenbar
npm install
npm run tauri build

Development

# Start dev server with hot reload
npm run tauri dev

Project Structure

tokenbar/
β”œβ”€β”€ src/                    # React frontend
β”‚   β”œβ”€β”€ components/         # UI components
β”‚   β”œβ”€β”€ hooks/              # React hooks
β”‚   └── lib/                # Utilities
β”œβ”€β”€ src-tauri/              # Rust backend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ main.rs         # Entry point
β”‚   β”‚   β”œβ”€β”€ tray.rs         # System tray logic
β”‚   β”‚   └── providers/      # Data source providers
β”‚   └── Cargo.toml
β”œβ”€β”€ public/                 # Static assets
└── package.json

How It Works

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    TokenBar                          β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                 β”‚
β”‚  β”‚   Tauri     │◄───│   React     β”‚                 β”‚
β”‚  β”‚  (Rust)     β”‚    β”‚  (Frontend) β”‚                 β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                 β”‚
β”‚         β”‚                                           β”‚
β”‚         β–Ό                                           β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚              Data Providers                  β”‚   β”‚
β”‚  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€   β”‚
β”‚  β”‚ Local JSON  β”‚ OAuth API   β”‚ CLI Fallback    β”‚   β”‚
β”‚  β”‚ (stats)     β”‚ (usage)     β”‚ (/usage)        β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Contributing

PRs welcome! See CONTRIBUTING.md.

Credits

  • Inspired by CodexBar by Peter Steinberger
  • Built with Tauri
  • Icon design by Farhan Khan

License

MIT License - see LICENSE


Made with ♾️ by khnfrhn

About

No description, website, or topics provided.

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Packages

 
 
 

Contributors