{"id":51337484,"url":"https://github.com/sairintechnologycom/burnlens","last_synced_at":"2026-07-02T04:03:16.599Z","repository":{"id":350218219,"uuid":"1204980839","full_name":"sairintechnologycom/burnlens","owner":"sairintechnologycom","description":"Open-source LLM FinOps proxy — track OpenAI, Anthropic (Claude), and Google Gemini costs by feature, team, and customer. Zero code changes. pip install burnlens.","archived":false,"fork":false,"pushed_at":"2026-06-12T13:24:20.000Z","size":2732,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-12T14:14:09.108Z","etag":null,"topics":["ai-cost","ai-finops","anthropic","budget-alerts","claude","cli","cost-tracking","developer-tools","fastapi","finops","gemini","gpt","llm","llm-observability","observability","openai","proxy","python","spend-tracking","token-counting"],"latest_commit_sha":null,"homepage":"https://burnlens.app","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sairintechnologycom.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING_AI.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-04-08T14:16:25.000Z","updated_at":"2026-06-12T13:24:25.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/sairintechnologycom/burnlens","commit_stats":null,"previous_names":["sairintechnologycom/burnlens"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/sairintechnologycom/burnlens","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sairintechnologycom%2Fburnlens","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sairintechnologycom%2Fburnlens/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sairintechnologycom%2Fburnlens/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sairintechnologycom%2Fburnlens/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sairintechnologycom","download_url":"https://codeload.github.com/sairintechnologycom/burnlens/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sairintechnologycom%2Fburnlens/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35032145,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-02T02:00:06.368Z","response_time":173,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-cost","ai-finops","anthropic","budget-alerts","claude","cli","cost-tracking","developer-tools","fastapi","finops","gemini","gpt","llm","llm-observability","observability","openai","proxy","python","spend-tracking","token-counting"],"created_at":"2026-07-02T04:03:15.622Z","updated_at":"2026-07-02T04:03:16.585Z","avatar_url":"https://github.com/sairintechnologycom.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BurnLens — The open-source FinOps proxy for AI spend\n\nTrack every dollar by feature, team, and customer across OpenAI, Anthropic, Google, Azure, AWS Bedrock, and Groq. Hard-cap budgets before the API call — not after the bill arrives.\n\n[![PyPI](https://img.shields.io/pypi/v/burnlens?label=pypi\u0026color=00e5c8)](https://pypi.org/project/burnlens)\n[![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue)](https://python.org)\n[![License: Apache 2.0](https://img.shields.io/badge/license-Apache--2.0-green)](LICENSE)\n[![GitHub stars](https://img.shields.io/github/stars/sairintechnologycom/burnlens?style=social)](https://github.com/sairintechnologycom/burnlens)\n\n```bash\npip install burnlens\nburnlens start\n# Dashboard at http://127.0.0.1:8420/ui\n```\n\n---\n\n## The Problem\n\n**Bills tell you the model, not the why.** Your invoice says `gpt-4o: $4,287`. It doesn't say which feature, which team, or which customer burned it. By the time you trace the spike, it's already on next month's card.\n\n**Alerts arrive after the damage.** A bad deploy, a runaway agent, or one abusive customer can trigger thousands of API calls before any dashboard turns red. You find out when you open the bill — or when your CEO does.\n\n**Every provider is a different silo.** OpenAI's usage page. Anthropic's console. Azure Cost Management. Bedrock CloudWatch. No unified view, no way to ask \"which feature is our biggest AI spend across all providers.\"\n\n---\n\n## How It Works\n\n1. **Drop-in proxy.** Point your SDK's `BASE_URL` at `localhost:8420`. Existing code works unchanged. Less than 20ms overhead. Full streaming passthrough. No changes to your application logic.\n\n2. **Tag what matters.** Three request headers (`X-BurnLens-Tag-Feature`, `X-BurnLens-Tag-Team`, `X-BurnLens-Tag-Customer`) attribute any call to any dimension. Tags are stripped before reaching the AI provider — they never leave your machine.\n\n3. **Cap before you call.** Register an API key with a daily dollar limit. At 100%, BurnLens returns `429` *before* the upstream request is made — not after the bill arrives. 50% and 80% thresholds fire Slack or email alerts.\n\n4. **One dashboard, every provider.** OpenAI, Anthropic, Google, Azure OpenAI, AWS Bedrock, and Groq spend in one unified view. Model breakdowns, waste detection, and budget tracking — reconciled to the provider bill.\n\n---\n\n## Code Example\n\n```python\nimport os, openai\n\nos.environ[\"OPENAI_BASE_URL\"] = \"http://127.0.0.1:8420/proxy/openai\"\n\nclient = openai.OpenAI(default_headers={\n    \"X-BurnLens-Tag-Feature\": \"chat\",\n    \"X-BurnLens-Tag-Team\": \"backend\",\n    \"X-BurnLens-Tag-Customer\": \"acme-corp\",\n})\n```\n\nTags are stripped before the request reaches OpenAI. They never appear in any API payload.\n\n---\n\n## Use Cases\n\n**Coding agents.** Cursor, Claude Code, Cline, Windsurf — attribute cost per PR, repo, or developer. Set a hard daily cap per API key so one runaway agent can't blow the team's monthly budget overnight.\n\n**Customer-facing AI.** Tag each request with a customer ID. See which customers drive the most cost. Enforce per-customer monthly spend limits with automatic 429 enforcement before the call is forwarded.\n\n**RAG and agents.** Tag retrieval calls, tool calls, and generation separately. See whether your vector search or synthesis step is the cost driver — and whether it justifies the output quality.\n\n**Internal tools.** Set per-team monthly budgets, get Slack alerts at 80% and 100%, and export monthly reports that reconcile line-by-line to the actual provider bill.\n\n---\n\n## Supported Providers\n\n| Provider | Status | Notes |\n|----------|--------|-------|\n| OpenAI | Stable | All models, streaming, reasoning tokens |\n| Anthropic | Stable | All models, streaming, prompt caching tokens |\n| Google | Stable | Gemini 1.5/2.0, requires `patch_google()` |\n| Azure OpenAI | Roadmap v0.3 | |\n| AWS Bedrock | Roadmap v0.3 | |\n| Groq | Roadmap v0.2 | |\n| Together | Roadmap v0.2 | |\n| Mistral | Roadmap v0.2 | |\n\n---\n\n## Why BurnLens\n\n| | BurnLens | Helicone / Langfuse | Vantage / CloudZero |\n|---|---|---|---|\n| Open source | ✓ | Partial | ✗ |\n| Local-first (prompts stay local) | ✓ | ✗ | ✗ |\n| Hard caps before API call | ✓ | ✗ | ✗ |\n| Per-customer attribution | ✓ | ✓ | ✗ |\n| Multi-cloud (Azure / AWS / GCP) | ✓ | Partial | ✓ |\n\n---\n\n## Dashboard\n\n![BurnLens dashboard — LLM cost tracking by model, feature, team, and customer](https://burnlens.app/opengraph-image)\n\n---\n\n## Configuration\n\nZero config required — sensible defaults out of the box. Optional `burnlens.yaml`:\n\n```yaml\nbudget_limit_usd: 500.00\nbudgets:\n  teams:\n    backend: 200.00\n    research: 100.00\n  customers:\n    acme-corp: 50.00\nalerts:\n  slack_webhook: https://hooks.slack.com/...\n```\n\n---\n\n## CLI\n\n```bash\nburnlens start                  # proxy + dashboard on :8420\nburnlens top                    # live cost by model (htop-style)\nburnlens report                 # weekly cost summary\nburnlens analyze                # waste detection report\nburnlens export                 # CSV of last 7 days\nburnlens run -- python app.py   # auto-tag a process with repo / dev / pr / branch\nburnlens key register \u003cname\u003e    # label an API key + set a daily cap\nburnlens key list               # list registered keys with caps\nburnlens keys                   # today's spend per registered key\nburnlens scan claude            # import Claude Code session costs from disk\nburnlens scan cursor            # import Cursor IDE session costs from disk\nburnlens scan codex             # import OpenAI Codex session costs from disk\nburnlens scan gemini            # import Gemini CLI session costs from disk\n```\n\n---\n\n## Contributing\n\nIssues and PRs welcome. See [CONTRIBUTING.md](CONTRIBUTING.md).\n\n```bash\ngit clone https://github.com/sairintechnologycom/burnlens\ncd burnlens\npip install -e \".[dev]\"\npytest\n```\n\n## License\n\n[Apache License 2.0](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsairintechnologycom%2Fburnlens","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsairintechnologycom%2Fburnlens","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsairintechnologycom%2Fburnlens/lists"}