I got a £340 Anthropic bill last month and had no idea it was coming. The usage dashboard is fine but you only check it after the damage is done.
So I built TokenLens. It shows the cost of every API call in your VS Code status bar as it happens.
How it works
TokenLens runs a local proxy on your machine. Point your SDK at it with one env var and every API call shows its cost in real time. No code changes needed.
Every call passes through the proxy. TokenLens reads the token counts, calculates the cost, and updates your status bar instantly — including streamed responses.
Your API keys and request data never leave your machine.
Setup
Install the extension
Cmd+Shift+P → TokenLens: Setup API Tracking
Select your providers — env vars are added to your .env automatically
Restart your dev server and start coding
Features
Live status bar — see today's spend at a glance: ⚡ $0.23
Full dashboard — cost by model, by provider, per call
Budget alerts — notified when you hit 75% or 90% of your monthly limit
All major providers — OpenAI, Anthropic, Google Gemini, Mistral
All data stays on your machine. The proxy runs on 127.0.0.1 and is never accessible outside your computer. Nothing is sent to any server on the free plan.