Skip to main content

Open-source LLM FinOps proxy — track OpenAI, Anthropic (Claude), and Google Gemini API costs by feature, team, and customer. Zero code changes.

Reason this release was yanked:

1.0.0 wheel was missing burnlens/cost/, burnlens/proxy/, and burnlens/cli — non-functional. Use 1.0.1 or later.

Project description

BurnLens — See exactly what your LLM API calls cost

pip install burnlens — open-source LLM FinOps proxy for OpenAI, Anthropic (Claude), and Google Gemini. Track real token costs, attribute spend to features, teams, and customers, and detect waste. Zero code changes. Everything runs locally.

PyPI Downloads License: Apache 2.0 Python 3.10+ GitHub stars

Zero code changes. Every dollar tracked. Works with the official OpenAI, Anthropic, and Google AI SDKs out of the box.


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 (Claude)
export ANTHROPIC_BASE_URL=http://127.0.0.1:8420/proxy/anthropic

# Google Gemini — one-line patch
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.


Why BurnLens

  • OpenAI and Anthropic bill by model, not by feature. You find out at month end which feature cost the most.
  • Reasoning tokens on o1 / o3 / Claude thinking models cost 10× more than expected. One prompt change can balloon your bill.
  • One bad deploy can burn $47K before anyone notices. Budget alerts catch it in minutes.

BurnLens fixes this at the proxy layer — no instrumentation, no SDK wrapping, no vendor lock-in.


What you get

BurnLens dashboard — LLM cost tracking by model, feature, team, and customer

  • Cost timeline — daily spend trend across all providers
  • Attribution — cost by model, feature, team, customer
  • Waste detection — context bloat, duplicate requests, model overkill
  • Per-request detail — tokens, cost, and latency for every call
  • Budget alerts — Slack + terminal notifications when you hit spend limits

Supported providers

Provider Models
OpenAI gpt-4o, gpt-4o-mini, o1, o3, o1-mini, gpt-4-turbo
Anthropic (Claude) claude-opus-4, claude-sonnet-4, claude-3-5-sonnet, claude-3-haiku
Google Gemini gemini-2.0-flash, gemini-1.5-pro, gemini-1.5-flash

Reasoning tokens, cached tokens, and vision tokens are all tracked separately.


CLI

burnlens start         # proxy + dashboard on :8420
burnlens top           # live cost by model (htop-style)
burnlens report        # weekly cost summary
burnlens analyze       # waste detection report
burnlens export        # CSV of last 7 days

Configuration

Zero config required — sensible defaults out of the box. Optional burnlens.yaml:

budget_limit_usd: 500.00
budgets:
  teams:
    backend: 200.00
    research: 100.00
alerts:
  slack_webhook: https://hooks.slack.com/...

How it works

App → SDK → BurnLens proxy (localhost:8420) → AI provider
                 ↓
           SQLite: logs request, calculates cost, extracts tags
                 ↓
        Dashboard (localhost:8420/ui) + CLI (burnlens top/report)
  • Local-first. Everything runs on localhost. No cloud account needed.
  • Privacy-preserving. Prompts and completions never leave your machine. API keys pass through, never stored remotely.
  • Streaming passthrough. SSE chunks forwarded immediately. < 20 ms proxy overhead.
  • Fail-open. If BurnLens can't log, it still forwards the request. Never breaks your app.

Cloud (optional)

Need team-wide dashboards and multi-workspace cost tracking? BurnLens Cloud offers:

  • Free — local proxy only (this repo)
  • Cloud — $29/mo — personal cloud dashboard, 7-day trial
  • Teams — $99/mo — multi-user workspaces, shared budgets

The CLI is free forever. Cloud is opt-in and only syncs anonymised cost records (tokens + cost — never prompts, completions, or API keys).


Contributing

Issues and PRs welcome. See CONTRIBUTING.md.

License

Apache License 2.0

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-1.0.0.tar.gz (46.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-1.0.0-py3-none-any.whl (52.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for burnlens-1.0.0.tar.gz
Algorithm Hash digest
SHA256 b7276e6e16402405dffba08e103d65e97780207d42174fdc6659a6c5ef062b68
MD5 f2c021bcf6633a72af263dd1b4ed32da
BLAKE2b-256 c1898254afcf7435e9c7932b178e9a3544ac83ef8f860812b1e1ac5e16009a1a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: burnlens-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 52.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.1

File hashes

Hashes for burnlens-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 74a1b03fcd4fc71cedbd6f0e030edb3d64c85942b302b52d06ee46703dddbce7
MD5 7310b913084a23dcf7d777500f4dcc3e
BLAKE2b-256 03ecbc5a892cf01939e2c8f5173f30d11683a2b528a0f4cc93cdde1448896389

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