Skip to main content

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.

PyPI License: MIT Python 3.10+


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

Dashboard screenshot

  • 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
Google 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

burnlens-0.1.2.tar.gz (592.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

burnlens-0.1.2-py3-none-any.whl (74.9 kB view details)

Uploaded Python 3

File details

Details for the file burnlens-0.1.2.tar.gz.

File metadata

  • Download URL: burnlens-0.1.2.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

Hashes for burnlens-0.1.2.tar.gz
Algorithm Hash digest
SHA256 45e691af723c4c4a045d45ef98648ce623e9a971f5661febad2cde3ccaed7a3b
MD5 df05ec9d656e88d2af7c52707d60610a
BLAKE2b-256 0aa2936be0fafe56f497815d4a6abf13ca075bd3a086e9a6c3dd35bd9e763936

See more details on using hashes here.

File details

Details for the file burnlens-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: burnlens-0.1.2-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

Hashes for burnlens-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e16e8d70cf36e120360cc15653604f063e92f1c588c0446a1d426097807e56a8
MD5 b4d443c3353f69aeb7bb1af9376728ac
BLAKE2b-256 c87ea825520ce0f7185612ae79d1ea3ccdd94b35b313ecdebce7cce018915358

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page