Token Guard

Free & open source

Route, track, and budget your LLM calls.

A tiny local gateway that speaks OpenAI, Anthropic, and Gemini SDK shapes. Track spend per project, enforce budgets, and keep your prompts on your machine.

macOS ยท Windows ยท Linux

.env
OPENAI_BASE_URL=http://localhost:3742/v1
OPENAI_API_KEY=tg_your-project-label

What it does

Everything runs locally. No cloud service, no account, no prompt logging.

Real-time cost tracking

Per-project, per-provider, per-model spend with local SQLite history.

Budgets & limits

Money, token, request, or time caps. Warn, block, or pause when a limit is hit.

3 ร— 3 format conversion

Use OpenAI, Anthropic, or Gemini SDKs against any configured provider.

Keys in the OS keychain

Provider API keys never touch your agent configs or the filesystem.

Provider fallback

Set a backup provider. Token Guard retries and fails over on 5xx or 429.

System tray app

Check spend, pause, or open the dashboard from the menu bar or tray.

How it works

One env var. No SDK changes. No extra hop.

01

Point your client

Set OPENAI_BASE_URL=http://localhost:3742/v1. Token Guard speaks OpenAI, Anthropic, and Gemini shapes.

02

Store your key

Add the real provider key in Token Guard. It lives in the OS keychain, not your agent config.

03

Tag projects

Use a label key like tg_your-project as OPENAI_API_KEY. Token Guard tags and forwards.

Support the project

Token Guard is free and open source. If it saves you money or time, you can support the author with a small one-time contribution.

$4.99

One-time. No subscription. Taxes calculated at checkout.

  • โœ“ Keep the project going
  • โœ“ Hide the support banner
  • โœ“ Automatic updates from GitHub Releases
  • โœ“ Use on up to 2 devices

Questions

Is Token Guard really free?
Yes. The app is open source under Apache-2.0. Every core feature works without paying. A supporter code removes the banner and enables auto-updates.
Do you see my prompts or API keys?
No. The app runs entirely on your machine. Your provider key is stored in the OS keychain, and requests go directly from your computer to the provider.
What platforms are supported?
macOS, Windows, and Linux. Binaries are built and published from GitHub Actions.
Can I get a refund?
Yes. Email qingquanshi65@gmail.com within 14 days for a full refund.