Know what your AI APIs
cost as they happen
Last month I got a £340 Anthropic bill I did not see coming. So I built something that shows the cost of every API call right in your VS Code status bar.
Works with OpenAI, Anthropic, Gemini and Mistral.
Free tier: unlimited tracking · your data never leaves your machine
| Time | Model | In | Out | Latency | Cost |
|---|---|---|---|---|---|
| Jul 5 14:32 | Claude Sonnet 4 | 2.4K | 820 | 1,240ms | $0.042 |
| Jul 5 14:28 | GPT-4o | 1.1K | 430 | 890ms | $0.018 |
| Jul 5 14:21 | Claude Sonnet 4 | 3.8K | 1.2K | 2,100ms | $0.071 |
| Jul 5 13:55 | Gemini 1.5 Flash | 5.2K | 890 | 620ms | $0.008 |
Everything you need to control AI costs
Built by a developer who got burned by a surprise bill.
Live status bar
Your spend shows in real time at the bottom of VS Code. Click it to open the full dashboard.
Zero code changes
One env var in your .env file. Works with the OpenAI SDK, LangChain, Vercel AI SDK, and any HTTP client.
Full breakdown
Cost by model, by provider, per call. Know exactly which call cost £0.12 and which cost £0.002.
Fully private
Runs 100% locally on your machine. Your prompts and API keys never leave your computer.
Budget alerts
Set a monthly limit. Get a notification in VS Code when you hit 75% and 90%.
All major providers
OpenAI, Anthropic, Google Gemini, Mistral. One extension tracks them all.
Up and running in 2 minutes
Install from VS Code
Search "TokenLens" in the Extensions panel or use the marketplace link above.
Run Setup
Cmd+Shift+P → "TokenLens: Setup". Picks your providers and writes one env var to your .env file.
See your costs
Restart your dev server. Costs appear in the status bar after the first API call.
Simple pricing
Start free. Upgrade when you need more history or team features.
Free
- ✓Unlimited API call tracking
- ✓OpenAI + Anthropic support
- ✓7-day history
- ✓Status bar cost display
- ✓Basic dashboard
- ✓100% local, no data sent
Pro
- ✓Everything in Free
- ✓Unlimited history
- ✓All providers (Gemini, Mistral)
- ✓Budget alerts
- ✓Export to CSV
- ✓Cloud backup and sync
- ✓Model comparison view
Team
- ✓Everything in Pro
- ✓Up to 10 developers
- ✓Shared team dashboard
- ✓Per-developer breakdown
- ✓Shared budget alerts
- ✓Priority support
Stop guessing what AI costs you
Free forever. No credit card. Your data stays on your machine.
Install TokenLens Free →