Install
The setup wizard runs automatically after install. You can skip it and configure later with npx burn0 init.
Add the import
Add this as the first import in your app’s entry file (before any SDK imports):
app.ts
index.ts (Next.js)
server.ts (any Node.js)
import '@burn0/burn0' // Must be first!
import express from 'express'
import OpenAI from 'openai'
// ... rest of your app
burn0 must be imported before any API SDK (OpenAI, Anthropic, etc.). It patches fetch and http globally — if an SDK initializes first, its calls won’t be tracked.
Run your app
You’ll see costs appear in your terminal as API calls happen:
burn0 ▸ $0.0038 today (3 calls) ── openai: $0.0035 · resend: $0.0003
When you stop the app (Ctrl+C):
burn0 ▸ session: $0.0038 (3 calls, 2m 15s) ── today: $0.0038 ── ~$3.42/mo
Check your costs
burn0 report ── last 7 days
Total: $12.47 (342 calls)
openai $8.32 ██████████████░░░░░░ 67%
anthropic $3.15 ██████░░░░░░░░░░░░░░ 25%
google-gemini $0.85 ██░░░░░░░░░░░░░░░░░░ 7%
resend $0.15 ░░░░░░░░░░░░░░░░░░░░ 1%
── projection ─────────────────────────────
~$53/mo estimated (based on last 7 days)
Optional: Connect to the dashboard
For team visibility and historical data, connect a free API key:
Create an API key
Navigate to Dashboard → API Keys → Create new key .
Add to your project
Paste your API key when prompted.
See costs in the dashboard
Next steps
CLI Reference All CLI commands
Track features Attribute costs to specific features
Dashboard Visual cost breakdown
Supported services 50+ services tracked