Skip to main content

burnrate

Stop overpaying for AI. burnrate audits your codebase for wasteful AI API usage, suggests targeted fixes, and can execute a full stack migration off expensive subscriptions.

The core insight: most devs pay $100–400/month for Cursor, Claude Max, and Copilot. The same output costs $20–40 via direct API + open-source tooling. Burnrate finds the gap and closes it.

Install

pipx install burnrate

Or with pip:

pip install --user burnrate

Quick start

burnrate auth                  # one-time setup: keys + system profiling
burnrate audit .               # scan your codebase (read-only)
burnrate fix .                 # patch the easy wins, with diff approvals
burnrate overhaul              # replace expensive subscriptions with API + open-source
burnrate status                # current-month spend vs subscription baseline
burnrate doctor                # verify the setup is healthy

Commands

burnrate auth

First-time setup. Prompts for API keys (Anthropic, OpenAI, Google, Groq, Mistral), detects your system (OS, RAM, shell, editor), and asks which paid AI tools you're subscribed to. Writes everything to ~/.burnrate/config.json. Keys never leave your machine.

burnrate audit [path]

Read-only scan. Finds:

  • Expensive model choices (e.g. claude-opus-4 for a simple classifier)
  • Missing max_tokens (unbounded response spend)
  • Long system prompts (>1k chars) without cache_control
  • Cross-language: Python (AST-based) and TypeScript/JavaScript (regex-based)

burnrate fix [path]

Applies code-level fixes. Shows a unified diff per finding and prompts y / n / skip / all (per-fix-kind batching). Add --dry-run to preview without writing. Fix types: model swap, add max_tokens, wrap system prompts with cache_control.

burnrate overhaul

Personalized stack-replacement plan. Reads your detected system + subscriptions; recommends replacements (Zed for Cursor, Anthropic API + Aider for Claude Max, Ollama + Qwen for Copilot). On approval, runs the installs (brew, pipx, ollama pull) with a single confirmation gate. Add --dry-run to see the plan without executing.

burnrate status

This month's API spend per provider, with subscription-baseline comparison. Queries the Anthropic and OpenAI Admin APIs (/v1/organizations/usage_report/messages and /v1/organization/costs). Requires admin-tier API keys — regular keys show "requires admin API key" gracefully. Subscription savings are shown regardless.

burnrate doctor

Verifies config, Python version, API key validity (via cheap GET /v1/models probes), and optional tools on PATH (Ollama, Aider, Zed). Exit 0 if all checks pass, 1 if any fail.

burnrate mcp

Starts an MCP (Model Context Protocol) server on stdio. Exposes four tools to MCP-compatible editors (Claude Code, Cursor, Zed):

  • burnrate_check_file(path) — scan a single file
  • burnrate_suggest_fix(code, finding_type) — return patched code
  • burnrate_get_spend() — current-month spend
  • burnrate_recommend_model(task_description) — most cost-effective model for the task

Register in your editor's MCP config:

{
  "mcpServers": {
    "burnrate": {
      "command": "burnrate",
      "args": ["mcp"]
    }
  }
}

Safety

  • burnrate fix shows every diff before writing. There's no --yes shortcut for v0 — confirm each kind or pipe all to batch.
  • burnrate overhaul shows every install command before running. Single confirmation gate; no per-step prompts during execution. --dry-run is always safe.
  • burnrate audit is fully read-only.
  • API keys live at ~/.burnrate/config.json. The CLI never transmits them to any third party.

If you want extra safety on fix, run it on a committed working tree so git diff is your undo.

Web companion

If you'd rather use a hosted UI, get personalized setup scripts, or track spend over time, burnrate.money has a paid tier ($12/mo or $49 lifetime) that complements the CLI.

Development

git clone https://github.com/saintbate/burnrate
cd burnrate/cli
python3 -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
pytest -q

License

MIT.

Release files for burnrate 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for burnrate 0.1.1
File Size Uploaded
burnrate-0.1.1.tar.gz 40.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for burnrate 0.1.1
File Interpreter ABI Platform
burnrate-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 86.9 kB

Release files / burnrate-0.1.1.tar.gz

Download URL burnrate-0.1.1.tar.gz
Size 40.2 kB
Tags Source
SHA-256 checksum
How to use checksums
c32d28a75f9bf894132060ebc07f2d6606d70e2bd216f69ec24ba8618ec32339
BLAKE2b-256 checksum
How to use checksums
bf7fd3036d980a5b1d6cefa1e4ebb6db48a19a08e9a593870880a288d7c550aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Release files / burnrate-0.1.1-py3-none-any.whl

Download URL burnrate-0.1.1-py3-none-any.whl
Size 46.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f727497fc687f1eaaa2e17e1e60a400859e7fb6699a6af3893f28120c3a5042c
BLAKE2b-256 checksum
How to use checksums
3255ced11d8f2cd9930fa75c47ae3ac33d0ccd6b9c14cf709261e9b0e8267a2f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page