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.3.1.tar.gz (592.2 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.3.1-py3-none-any.whl (75.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: burnlens-0.3.1.tar.gz
  • Upload date:
  • Size: 592.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.1

File hashes

Hashes for burnlens-0.3.1.tar.gz
Algorithm Hash digest
SHA256 b5be8ed67ff03e6f9f2768270dd4bba8c0bfff21f8423a4a8e85179402ae68b6
MD5 17246b6d2242ff1d02d5a9240c7978f5
BLAKE2b-256 f8979244587a40fba12d00062e31a438ba08dc631e695135b20b462e0443e4b4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: burnlens-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 75.1 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.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8c0c31e7a1440c4c362aedd1f23e958b5d31334311cb52547e20653ceba28600
MD5 632ce6d362b5a4194fb2e687537152f0
BLAKE2b-256 d177792edd74be357dc1c86219de4a0acc593056d34e80a091ec7c7ebcf9b1cf

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