All your AI usage. One menu bar.
TokenBar is a native macOS menu bar app that shows your AI provider usage at a glance — tokens, cost, credits, and quota — without opening a single dashboard. It lives in the menu bar, stays out of your way, and only ever shows real data (no mock/placeholder numbers).
- Screenshots
- Features
- Supported providers
- What data is real?
- Install (prebuilt app)
- Build from source
- How to connect a provider
- Privacy & security
- Architecture
- Contributing
- License
The menu bar popover: an aggregate header, per-provider status/usage rows, and quick actions (Refresh, Add Provider, About, Quit).
- Native macOS menu bar app (SwiftUI + AppKit).
- Menu bar total with a battery-style colored gauge for quota.
- Per-provider detail: tokens, cost, credit limit / remaining, quota, requests.
- Real usage only — providers without a public usage API are not shipped.
- Connect with an API key or, for Claude, reuse the Claude CLI login (no key typing). Installed CLIs are auto-detected and added for you.
- Secure API key storage in the macOS Keychain.
- Refresh on open, on demand, and automatic re-detection of newly installed CLIs.
- Lightweight and quiet: no telemetry, no analytics.
| Provider | What it shows |
|---|---|
| OpenRouter | Real credits spent, credit limit, remaining, and quota % |
| DeepSeek | Real remaining prepaid balance |
| Anthropic (Claude) | Real local session tokens (via the Claude CLI) |
| OpenAI | Connection status (key validation) |
Providers that expose no public per-key usage API were intentionally removed, so you never see a bare "Connected" with nothing useful.
Most AI providers do not expose per-API-key usage over their public API, so TokenBar shows only what is genuinely available:
- OpenRouter and DeepSeek return real credit/balance data for a normal key.
- Claude usage comes from your local Claude CLI session logs (real tokens spent locally; this is not your server-side subscription quota).
- Token limits are not exposed by any provider for standard keys — the limits/remaining you see are credits (USD), e.g. an OpenRouter credit cap.
Requirements: macOS 14 (Sonoma) or newer, Apple Silicon or Intel (the build is universal).
-
Download
TokenBar.zipfrom this repo and unzip it. -
The app is signed but not notarized, so macOS Gatekeeper blocks it on first launch. Clear the quarantine flag (adjust the path to where the app is):
xattr -dr com.apple.quarantine ~/Downloads/TokenBar.app -
Double-click TokenBar.app. It's a menu bar app — there is no Dock icon and no window. Look for the icon in the top-right menu bar.
-
Optionally move it to
/Applications.
The first time TokenBar reads a Claude CLI credential, macOS shows a Keychain prompt — click Always Allow.
Requirements: Xcode 16+ (Swift 6), macOS 14+.
git clone https://github.com/champ96k/token-bar.git
cd token-bar
open TokenBar.xcodeproj # then Build & Run (⌘R)Or build a release copy from the command line:
xcodebuild -project TokenBar.xcodeproj -scheme TokenBar -configuration Release \
-derivedDataPath build ARCHS="arm64 x86_64" ONLY_ACTIVE_ARCH=NO build
# app: build/Build/Products/Release/TokenBar.appNote: the App Sandbox is intentionally disabled so TokenBar can read local CLI credentials/usage. This is compatible with Developer ID / notarized distribution but not with the Mac App Store.
Open the menu bar icon → Add Provider, pick a provider, then choose a connection method:
- API Key — paste your key; it is validated and stored in the Keychain.
- CLI (Claude only) — if the
claudeCLI is installed and logged in, TokenBar reuses its saved credential. You can also click Log in via CLI to open Terminal and authenticate.
Get API keys here: OpenRouter · DeepSeek · OpenAI · Anthropic.
- API keys are stored only in the macOS Keychain.
- No telemetry, tracking, or analytics.
- Network requests go directly to each provider's official API.
- Claude usage is read from local files on your machine only.
- Language / UI: Swift 6, SwiftUI, AppKit for the menu bar.
- State:
@ObservableProviderManageras the single coordinator. - Providers: a
ProviderServiceper provider behind aProviderRegistry. - Usage sources: pluggable
UsageSources resolved per provider (LocalCLIUsageSourcefor Claude,APIKeyUsageSourcefor keys). - Networking:
URLSessionwith retry/backoff. - Storage:
UserDefaultsfor the provider list, Keychain for secrets.
High-level flow:
Menu bar → StatusItemManager → ProviderManager → UsageSourceResolver → Provider API → Usage
Contributions are welcome. Please keep changes small and focused, and open an
issue for larger proposals. Adding a provider is one entry in
ProviderRegistry plus a ProviderService — but only add providers that can
return real usage data.
Released under the MIT License. © 2026 Tushar Nikam.
