Metadata-Version: 2.4
Name: burnlens
Version: 0.3.1
Summary: See where your LLM money goes. Open-source proxy for AI API cost tracking, waste detection, and budget alerts.
Project-URL: Homepage, https://burnlens.app
Project-URL: Documentation, https://burnlens.app/docs
Project-URL: Repository, https://github.com/burnlens/burnlens
Project-URL: Issues, https://github.com/burnlens/burnlens/issues
Author-email: Bhushan <hello@burnlens.app>
License: Apache-2.0
Keywords: ai,anthropic,cost,finops,llm,monitoring,openai,proxy
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: System :: Monitoring
Requires-Python: >=3.10
Requires-Dist: aiosqlite>=0.20.0
Requires-Dist: fastapi>=0.110.0
Requires-Dist: httpx>=0.27.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: rich>=13.7.0
Requires-Dist: typer>=0.12.0
Requires-Dist: uvicorn[standard]>=0.27.0
Provides-Extra: dev
Requires-Dist: httpx[http2]>=0.27.0; extra == 'dev'
Requires-Dist: mypy>=1.8; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: respx>=0.21.0; extra == 'dev'
Requires-Dist: ruff>=0.3.0; extra == 'dev'
Provides-Extra: otel
Requires-Dist: opentelemetry-api>=1.20; extra == 'otel'
Requires-Dist: opentelemetry-exporter-otlp-proto-grpc>=1.20; extra == 'otel'
Requires-Dist: opentelemetry-sdk>=1.20; extra == 'otel'
Description-Content-Type: text/markdown

# BurnLens

> See exactly what your LLM API calls cost — per feature, team, and customer.  
> Zero code changes. Everything local.

[![PyPI](https://img.shields.io/pypi/v/burnlens)](https://pypi.org/project/burnlens)
[![License: MIT](https://img.shields.io/badge/license-MIT-green)](LICENSE)
[![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue)](https://python.org)

---

## Install

```bash
pip install burnlens
burnlens start
# Dashboard → http://127.0.0.1:8420/ui
```

## Point your SDK at the proxy

```bash
# 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](docs/dashboard.png)

- **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

```bash
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

```yaml
# burnlens.yaml (optional — sensible defaults without it)
budget_limit_usd: 500.00
budgets:
  teams:
    backend: 200.00
    research: 100.00
```

---

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md). Issues and PRs welcome.

## License

MIT
