@burn0/burn0 0.2.4 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +84 -116
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -54,10 +54,10 @@ npm i @burn0/burn0
|
|
|
54
54
|
Add one line to your entry file:
|
|
55
55
|
|
|
56
56
|
```typescript
|
|
57
|
-
import
|
|
57
|
+
import "@burn0/burn0"; // Must be first import
|
|
58
58
|
|
|
59
|
-
import express from
|
|
60
|
-
import OpenAI from
|
|
59
|
+
import express from "express";
|
|
60
|
+
import OpenAI from "openai";
|
|
61
61
|
// ... your app runs exactly the same
|
|
62
62
|
```
|
|
63
63
|
|
|
@@ -73,6 +73,23 @@ On exit:
|
|
|
73
73
|
burn0 ▸ session: $0.47 (12 calls, 4m 22s) ── today: $14.32 ── ~$430/mo
|
|
74
74
|
```
|
|
75
75
|
|
|
76
|
+
### Want full history and dashboards? Add an API key:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
# 1. Sign in with GitHub and create a key
|
|
80
|
+
open https://burn0.dev/login
|
|
81
|
+
# → Dashboard → API Keys → Create Key
|
|
82
|
+
|
|
83
|
+
# 2. Add it to your project
|
|
84
|
+
echo 'BURN0_API_KEY=b0_sk_your_key_here' >> .env
|
|
85
|
+
|
|
86
|
+
# 3. Restart — costs now sync to burn0.dev
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Now you get a **live event feed**, **cost breakdown by service**, **monthly projections**, and **full request history** — all at [burn0.dev/dashboard](https://burn0.dev/dashboard).
|
|
90
|
+
|
|
91
|
+
> burn0 only syncs metadata (service, model, tokens, cost, latency) — never request/response bodies or your API keys.
|
|
92
|
+
|
|
76
93
|
---
|
|
77
94
|
|
|
78
95
|
## How It Compares
|
|
@@ -128,67 +145,18 @@ resend $0.15 ░░░░░░░░░░░░░░░░░░░
|
|
|
128
145
|
|
|
129
146
|
---
|
|
130
147
|
|
|
131
|
-
## Dashboard — See Everything in One Place
|
|
132
|
-
|
|
133
|
-
The terminal is great for development. But when you want history, trends, and team visibility — connect to the **free dashboard** at [burn0.dev](https://burn0.dev).
|
|
134
|
-
|
|
135
|
-
### Get started in 60 seconds:
|
|
136
|
-
|
|
137
|
-
```bash
|
|
138
|
-
# 1. Sign in with GitHub
|
|
139
|
-
open https://burn0.dev/login
|
|
140
|
-
|
|
141
|
-
# 2. Go to your dashboard and copy your API key
|
|
142
|
-
# Dashboard → API Keys → Create Key
|
|
143
|
-
|
|
144
|
-
# 3. Add the key to your project
|
|
145
|
-
echo 'BURN0_API_KEY=b0_sk_your_key_here' >> .env
|
|
146
|
-
|
|
147
|
-
# 4. Restart your app — costs now sync to the dashboard
|
|
148
|
-
npm run dev
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
That's it. Every API call is now tracked in the dashboard.
|
|
152
|
-
|
|
153
|
-
### What you'll see:
|
|
154
|
-
|
|
155
|
-
| Feature | Description |
|
|
156
|
-
|---|---|
|
|
157
|
-
| **Live Event Feed** | Every API call streams in real-time — service, model, tokens, cost, latency |
|
|
158
|
-
| **Cost Breakdown** | Per-service, per-model cost breakdown with visual charts |
|
|
159
|
-
| **Monthly Projection** | Estimated monthly spend based on your actual usage trends |
|
|
160
|
-
| **Request History** | Full history of every tracked API call, searchable and filterable |
|
|
161
|
-
| **API Key Management** | Create, list, and revoke keys from the dashboard |
|
|
162
|
-
|
|
163
|
-
### How it works:
|
|
164
|
-
|
|
165
|
-
```
|
|
166
|
-
Your app (with BURN0_API_KEY set)
|
|
167
|
-
│
|
|
168
|
-
├─ Costs still appear in your terminal (nothing changes)
|
|
169
|
-
│
|
|
170
|
-
└─ Events also sync to burn0.dev ──→ Dashboard
|
|
171
|
-
│
|
|
172
|
-
├─ Only metadata: service, model, tokens, cost, status, latency
|
|
173
|
-
└─ Never request/response bodies. Never your API keys.
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
> **Privacy**: burn0 never reads your request or response content. Only metadata is synced — service name, model, token counts, cost, status code, and latency. Your API keys and data stay on your machine.
|
|
177
|
-
|
|
178
|
-
---
|
|
179
|
-
|
|
180
148
|
## Feature Attribution
|
|
181
149
|
|
|
182
150
|
Know exactly which feature burns money:
|
|
183
151
|
|
|
184
152
|
```typescript
|
|
185
|
-
import { track } from
|
|
153
|
+
import { track } from "@burn0/burn0";
|
|
186
154
|
|
|
187
|
-
await track(
|
|
188
|
-
const profile = await ai.generateProfile(user)
|
|
189
|
-
await stripe.createSubscription(user.id)
|
|
190
|
-
await sendWelcomeEmail(user.email)
|
|
191
|
-
})
|
|
155
|
+
await track("onboarding", async () => {
|
|
156
|
+
const profile = await ai.generateProfile(user);
|
|
157
|
+
await stripe.createSubscription(user.id);
|
|
158
|
+
await sendWelcomeEmail(user.email);
|
|
159
|
+
});
|
|
192
160
|
```
|
|
193
161
|
|
|
194
162
|
```
|
|
@@ -208,55 +176,55 @@ burn0 auto-detects services from hostnames. Zero configuration.
|
|
|
208
176
|
|
|
209
177
|
### AI / LLMs
|
|
210
178
|
|
|
211
|
-
| Service
|
|
212
|
-
|
|
213
|
-
| OpenAI
|
|
214
|
-
| Anthropic
|
|
179
|
+
| Service | Detection | Pricing Model |
|
|
180
|
+
| ------------- | ----------------------------------- | ----------------- |
|
|
181
|
+
| OpenAI | `api.openai.com` | Per-token (exact) |
|
|
182
|
+
| Anthropic | `api.anthropic.com` | Per-token (exact) |
|
|
215
183
|
| Google Gemini | `generativelanguage.googleapis.com` | Per-token (exact) |
|
|
216
|
-
| Mistral
|
|
217
|
-
| Cohere
|
|
218
|
-
| Groq
|
|
219
|
-
| Together AI
|
|
220
|
-
| Perplexity
|
|
221
|
-
| DeepSeek
|
|
222
|
-
| Replicate
|
|
223
|
-
| Fireworks AI
|
|
224
|
-
| AI21 Labs
|
|
225
|
-
| Pinecone
|
|
184
|
+
| Mistral | `api.mistral.ai` | Per-token (exact) |
|
|
185
|
+
| Cohere | `api.cohere.ai` | Per-token |
|
|
186
|
+
| Groq | `api.groq.com` | Per-token |
|
|
187
|
+
| Together AI | `api.together.xyz` | Per-token |
|
|
188
|
+
| Perplexity | `api.perplexity.ai` | Per-token |
|
|
189
|
+
| DeepSeek | `api.deepseek.com` | Per-token |
|
|
190
|
+
| Replicate | `api.replicate.com` | Per-second |
|
|
191
|
+
| Fireworks AI | `api.fireworks.ai` | Per-token |
|
|
192
|
+
| AI21 Labs | `api.ai21.com` | Per-token |
|
|
193
|
+
| Pinecone | `*.pinecone.io` | Per-request |
|
|
226
194
|
|
|
227
195
|
### Pay-per-use APIs
|
|
228
196
|
|
|
229
|
-
| Service
|
|
230
|
-
|
|
231
|
-
| Stripe
|
|
232
|
-
| PayPal
|
|
233
|
-
| Plaid
|
|
234
|
-
| SendGrid
|
|
235
|
-
| Resend
|
|
236
|
-
| Twilio
|
|
237
|
-
| Vonage
|
|
238
|
-
| Algolia
|
|
239
|
-
| Google Maps | `maps.googleapis.com` | Per-request
|
|
240
|
-
| Mapbox
|
|
241
|
-
| Cloudinary
|
|
242
|
-
| Sentry
|
|
243
|
-
| Segment
|
|
244
|
-
| Mixpanel
|
|
197
|
+
| Service | Detection | Pricing Model |
|
|
198
|
+
| ----------- | --------------------- | --------------- |
|
|
199
|
+
| Stripe | `api.stripe.com` | Per-transaction |
|
|
200
|
+
| PayPal | `api.paypal.com` | Per-transaction |
|
|
201
|
+
| Plaid | `*.plaid.com` | Per-request |
|
|
202
|
+
| SendGrid | `api.sendgrid.com` | Per-email |
|
|
203
|
+
| Resend | `api.resend.com` | Per-email |
|
|
204
|
+
| Twilio | `api.twilio.com` | Per-message |
|
|
205
|
+
| Vonage | `api.nexmo.com` | Per-message |
|
|
206
|
+
| Algolia | `*.algolia.net` | Per-search |
|
|
207
|
+
| Google Maps | `maps.googleapis.com` | Per-request |
|
|
208
|
+
| Mapbox | `api.mapbox.com` | Per-request |
|
|
209
|
+
| Cloudinary | `api.cloudinary.com` | Per-transform |
|
|
210
|
+
| Sentry | `sentry.io` | Per-event |
|
|
211
|
+
| Segment | `api.segment.io` | Per-event |
|
|
212
|
+
| Mixpanel | `api.mixpanel.com` | Per-event |
|
|
245
213
|
|
|
246
214
|
### Databases & Infrastructure
|
|
247
215
|
|
|
248
|
-
| Service
|
|
249
|
-
|
|
250
|
-
| Supabase
|
|
251
|
-
| PlanetScale
|
|
252
|
-
| MongoDB Atlas | `*.mongodb.net`
|
|
253
|
-
| Upstash
|
|
254
|
-
| Neon
|
|
255
|
-
| Turso
|
|
256
|
-
| Firebase
|
|
257
|
-
| AWS S3
|
|
258
|
-
| AWS Lambda
|
|
259
|
-
| Vercel
|
|
216
|
+
| Service | Detection | Pricing Model |
|
|
217
|
+
| ------------- | ------------------------ | -------------- |
|
|
218
|
+
| Supabase | `*.supabase.co` | Per-request |
|
|
219
|
+
| PlanetScale | `*.psdb.cloud` | Per-request |
|
|
220
|
+
| MongoDB Atlas | `*.mongodb.net` | Per-request |
|
|
221
|
+
| Upstash | `*.upstash.io` | Per-request |
|
|
222
|
+
| Neon | `*.neon.tech` | Per-request |
|
|
223
|
+
| Turso | `*.turso.io` | Per-request |
|
|
224
|
+
| Firebase | `*.firebaseio.com` | Per-request |
|
|
225
|
+
| AWS S3 | `*.s3.amazonaws.com` | Per-request |
|
|
226
|
+
| AWS Lambda | `lambda.*.amazonaws.com` | Per-invocation |
|
|
227
|
+
| Vercel | `api.vercel.com` | Per-request |
|
|
260
228
|
|
|
261
229
|
**Unknown APIs are auto-tracked by request count.** Nothing slips through.
|
|
262
230
|
|
|
@@ -289,10 +257,10 @@ Your app starts
|
|
|
289
257
|
|
|
290
258
|
## Two Modes
|
|
291
259
|
|
|
292
|
-
| Mode
|
|
293
|
-
|
|
294
|
-
| **Local** (default) | No
|
|
295
|
-
| **Cloud** (opt-in)
|
|
260
|
+
| Mode | API Key | What happens |
|
|
261
|
+
| ------------------- | ------- | ------------------------------------------------------------------------------------------------------------- |
|
|
262
|
+
| **Local** (default) | No | Costs in terminal + local ledger. Zero network calls to burn0. |
|
|
263
|
+
| **Cloud** (opt-in) | Yes | Same as local + events sync to [dashboard](https://burn0.dev/dashboard) for full history and team visibility. |
|
|
296
264
|
|
|
297
265
|
> **Start local, upgrade when ready.** burn0 works perfectly without an API key. When you want history and dashboards, add a key — it takes 60 seconds. [Get your free API key →](https://burn0.dev/login)
|
|
298
266
|
|
|
@@ -300,12 +268,12 @@ Your app starts
|
|
|
300
268
|
|
|
301
269
|
## Configuration
|
|
302
270
|
|
|
303
|
-
| Env Variable
|
|
304
|
-
|
|
305
|
-
| `BURN0_API_KEY`
|
|
306
|
-
| `BURN0_API_URL`
|
|
307
|
-
| `BURN0_DEBUG`
|
|
308
|
-
| `BURN0_ENABLE_TEST` | —
|
|
271
|
+
| Env Variable | Default | Description |
|
|
272
|
+
| ------------------- | ----------------------- | --------------------------------------- |
|
|
273
|
+
| `BURN0_API_KEY` | — | API key for cloud mode |
|
|
274
|
+
| `BURN0_API_URL` | `https://api.burn0.dev` | Backend URL |
|
|
275
|
+
| `BURN0_DEBUG` | `false` | Enable debug logging |
|
|
276
|
+
| `BURN0_ENABLE_TEST` | — | Set to `1` to enable in `NODE_ENV=test` |
|
|
309
277
|
|
|
310
278
|
---
|
|
311
279
|
|
|
@@ -359,12 +327,12 @@ npm test
|
|
|
359
327
|
|
|
360
328
|
## Community
|
|
361
329
|
|
|
362
|
-
| Channel
|
|
363
|
-
|
|
364
|
-
| 🌐 Website | [burn0.dev](https://burn0.dev)
|
|
365
|
-
| 📖 Docs
|
|
366
|
-
| 🐦 Twitter | [@burn0dev](https://twitter.com/burn0dev)
|
|
367
|
-
| 💻 GitHub
|
|
330
|
+
| Channel | Link |
|
|
331
|
+
| ---------- | ----------------------------------------------------- |
|
|
332
|
+
| 🌐 Website | [burn0.dev](https://burn0.dev) |
|
|
333
|
+
| 📖 Docs | [docs.burn0.dev](https://docs.burn0.dev) |
|
|
334
|
+
| 🐦 Twitter | [@burn0dev](https://twitter.com/burn0dev) |
|
|
335
|
+
| 💻 GitHub | [burn0-dev/burn0](https://github.com/burn0-dev/burn0) |
|
|
368
336
|
|
|
369
337
|
---
|
|
370
338
|
|