A local gateway for your coding agents.
Token Guard is a free, open-source desktop app that sits between your agents and OpenAI, Anthropic, or Gemini. Track cost per project, enforce budgets, and fail over to backup providers โ without ever sending your prompts anywhere else.
macOS ยท Windows ยท Linux
How it works
One environment variable. No SDK changes. No extra network hop.
Point your client
Set OPENAI_BASE_URL=http://localhost:3742/v1. Token Guard speaks the OpenAI, Anthropic, and Gemini SDK shapes natively.
Add your real key
Store your provider API key in Token Guard once. It lives in the OS keychain and is never written to your agent's config.
Tag projects
Give each project a label key and use it as OPENAI_API_KEY in that agent. Token Guard tags the request and forwards with your real key.
Everything you need to control spend
Real-time cost tracking
See spend per project, provider, model, and day. Catch runaway agents before they rack up a bill.
Budgets & limits
Set money, token, request, or time caps by project or globally. Choose warn, block, or pause when a limit is hit.
One proxy, three API shapes
Use OpenAI, Anthropic, or Google Gemini SDKs against any configured provider. Requests, responses, and streams are converted automatically.
Provider fallback
Link a backup provider to each primary. If the main provider returns a 5xx or 429, Token Guard retries and falls back automatically.
Keys in the OS keychain
API keys live in Windows Credential Manager, macOS Keychain, or Linux Secret Service. Your code and config files never touch them.
Native tray app
Pause, resume, open the dashboard, or check today's spend from the system tray on macOS, Windows, and Linux.
Daily & per-project history
SQLite-backed history with charts per project and provider. See trends over days and spot cost spikes early.
Desktop notifications
Get alerted when a project hits a budget threshold or a provider goes down, right on your desktop.
Auto-start & background run
Launch at login and keep the proxy running in the background. Your agents work even when the window is closed.
One env var. Done.
Your existing OpenAI-compatible client keeps working. Token Guard only intercepts the base URL.
OPENAI_API_KEY=tg_your-project-label-key
| Token Guard | Cloud gateways | Self-host (LiteLLM) | |
|---|---|---|---|
| Can see your prompts | Cannot | Can | Can |
| Extra network hops | 0 | 2 | 1 |
| Setup | 1 env var | SDK + account | Docker + Python |
| Where keys live | OS keychain | Their cloud | Server env |
| Native tray app | Yes | No | No |
| Multi-format SDK support | OpenAI / Anthropic / Google | Varies | Usually OpenAI only |
Support the project
Token Guard is free and open source. If you find it useful, you can support the author with a small one-time contribution.
$4.99 USD
One-time. No subscription.
Taxes may apply and will be calculated at checkout.
- โ Keep the project going
- โ Remove the support banner
- โ Automatic updates from GitHub Releases
- โ Use on up to 2 devices
Frequently asked questions
- Is Token Guard really free?
- Yes. The app is open source under Apache-2.0. Download from GitHub Releases and use every core feature. The $4.99 supporter code removes the banner and enables automatic updates.
- Do you see my prompts or API keys?
- No. The app runs entirely on your machine. Your provider API key is stored in the OS keychain, and requests go straight from your computer to the provider.
- What does supporting the project get me?
- It helps keep development going. As a thank-you, the support banner is hidden and auto-updates from GitHub Releases are enabled on up to 2 devices.
- Can I get a refund?
- Yes. If you're not happy, email qingquanshi65@gmail.com within 14 days for a full refund. See the refund policy.
Built in the open
Download Token Guard for free, star it on GitHub, or support the author if it saves you time and money.