Skip to content

Repository files navigation

TokenBar

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).


Table of contents


Screenshots

TokenBar main popover showing connected providers

The menu bar popover: an aggregate header, per-provider status/usage rows, and quick actions (Refresh, Add Provider, About, Quit).


Features

  • 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.

Supported providers

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.


What data is real?

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.

Install (prebuilt app)

Requirements: macOS 14 (Sonoma) or newer, Apple Silicon or Intel (the build is universal).

  1. Download TokenBar.zip from this repo and unzip it.

  2. 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
  3. 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.

  4. Optionally move it to /Applications.

The first time TokenBar reads a Claude CLI credential, macOS shows a Keychain prompt — click Always Allow.


Build from source

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.app

Note: 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.


How to connect a provider

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 claude CLI 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.


Privacy & security

  • 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.

Architecture

  • Language / UI: Swift 6, SwiftUI, AppKit for the menu bar.
  • State: @Observable ProviderManager as the single coordinator.
  • Providers: a ProviderService per provider behind a ProviderRegistry.
  • Usage sources: pluggable UsageSources resolved per provider (LocalCLIUsageSource for Claude, APIKeyUsageSource for keys).
  • Networking: URLSession with retry/backoff.
  • Storage: UserDefaults for the provider list, Keychain for secrets.

High-level flow:

Menu bar → StatusItemManager → ProviderManager → UsageSourceResolver → Provider API → Usage

Contributing

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.


License

Released under the MIT License. © 2026 Tushar Nikam.

About

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.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages