Skip to main content

burn0 init

Configures burn0 for your project. Runs automatically on npm install (in interactive terminals) or manually:
npx burn0 init

What it does

1

API key

Choose to paste an existing key, get a free one at burn0.dev/api, or skip (local mode).
2

Detect services

Scans your package.json and codebase for known API services. Shows what it found with auto-priced or plan-selection prompts.
3

Configure

Writes .burn0/config.json, adds .burn0/ and .env to .gitignore.

Example

  burn0 — track every API cost

  API key?
    ○ Paste key
    ○ Get one free → burn0.dev/api
    ○ Skip — local mode

  Auto-detected 4 services:

    ✓  OpenAI               auto-priced
    ✓  Stripe               auto-priced
    ✓  Supabase             needs plan
    ✓  Vercel               needs plan

  Supabase — which plan? Pro — $25/mo
  Vercel — which plan? Pro — $20/mo

  Add other services you use? (Y/n)

  ✓ Added .env to .gitignore (protects your API keys)
  ✓ Config synced to burn0.dev

  ✓ Setup complete

  Add this to your entry file:
    import '@burn0/burn0'

  Then run your app to see costs.

Files created

FilePurpose
.burn0/config.jsonProject name, services, plan selections
.envBURN0_API_KEY (if provided)
.env.exampleBURN0_API_KEY= placeholder

Re-running

Run npx burn0 init again at any time to reconfigure. It overwrites the existing config.

CI / Non-interactive

In CI/Docker (no TTY), init doesn’t run. It prints:
[burn0] Run "npx burn0 init" to set up cost tracking.