See where your LLM money goes. Open-source proxy for AI API cost tracking, waste detection, and budget alerts.
Project description
BurnLens
See exactly what your LLM API calls cost — per feature, team, and customer.
Zero code changes. Everything local.
Install
pip install burnlens
burnlens start
# Dashboard → http://127.0.0.1:8420/ui
Point your SDK at the proxy
# OpenAI — note the /v1 suffix
export OPENAI_BASE_URL=http://127.0.0.1:8420/proxy/openai/v1
# Anthropic
export ANTHROPIC_BASE_URL=http://127.0.0.1:8420/proxy/anthropic
# Google (one import instead of env var)
import burnlens.patch; burnlens.patch.patch_google()
Your existing SDK code works unchanged. BurnLens intercepts, logs, and forwards — nothing else.
Tag any request for attribution
X-BurnLens-Tag-Feature: chat
X-BurnLens-Tag-Team: backend
X-BurnLens-Tag-Customer: acme-corp
Tags are stripped before reaching the AI provider. They never leave your machine.
The problem
- OpenAI bills by model, not by feature. You find out at month end.
- Reasoning tokens on o1/o3 can cost 10× more than expected.
- One bad deploy can cost $47K before anyone notices.
BurnLens fixes this at the proxy layer — no instrumentation, no SDK wrapping, no vendor lock-in.
What you get
- Cost timeline — daily spend trend across all providers
- Attribution — cost by model, feature, team, customer
- Waste alerts — context bloat, duplicate requests, model overkill
- Per-request detail — tokens, cost, and latency for every call
Providers
| Provider | Models |
|---|---|
| OpenAI | gpt-4o, gpt-4o-mini, o1, o3, o1-mini, and more |
| Anthropic | claude-3-5-sonnet, claude-3-haiku, claude-opus-4-6, and more |
| gemini-1.5-pro, gemini-1.5-flash, gemini-2.0-flash, and more |
CLI
burnlens start # proxy + dashboard
burnlens export # CSV of last 7 days
burnlens report # weekly cost summary
burnlens recommend # cheaper model suggestions
burnlens budgets # team spend vs limits
Configuration
# burnlens.yaml (optional — sensible defaults without it)
budget_limit_usd: 500.00
budgets:
teams:
backend: 200.00
research: 100.00
Contributing
See CONTRIBUTING.md. Issues and PRs welcome.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file burnlens-0.3.0.tar.gz.
File metadata
- Download URL: burnlens-0.3.0.tar.gz
- Upload date:
- Size: 592.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e5ff4bd8d659df4752647f5437a5799bd74ae9c9094322207cae4a460c3ab709
|
|
| MD5 |
f3190f6fafe3a5f27555e8842d252416
|
|
| BLAKE2b-256 |
046cd67119dd94d2e8d625020f116c79af59be6c9b1426b72ff8f4179f4bf157
|
File details
Details for the file burnlens-0.3.0-py3-none-any.whl.
File metadata
- Download URL: burnlens-0.3.0-py3-none-any.whl
- Upload date:
- Size: 74.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
13975b7d644b0b957b1005175019b47525cffe38274a11c9e7abb5b59563718b
|
|
| MD5 |
79d433b1931ecc34b3d128caecc94737
|
|
| BLAKE2b-256 |
7ab1e080e2510a749e056453e59d7b13a10389c80547eb9dc21181d48e57d0fd
|