Track token spend, detect spikes, and optimize model usage across your AI features. SDK in 60 seconds.
The problem
A single bad prompt or runaway loop can spike your bill overnight with no warning.
Engineers swap models without realizing the cost difference. Expensive models sneak into cheap feature paths.
By the time you see the invoice, the damage is done. There's no way to trace which feature caused it.
The solution
See spend update as events come in.
Know exactly which AI feature costs what.
Compare GPT-4o vs Claude vs Gemini side by side.
Daily spend charts with full history.
Email and Slack alerts when spend exceeds thresholds.
Separate workspaces for every product or team.
One init call, one track call. Done.
Set per-feature thresholds before you overspend.
How it works
One npm install and you're set. Works with any Node.js or edge runtime.
Call metrics.track() after each LLM response. Fire-and-forget — it won't slow your app.
Open your dashboard and watch spend, tokens, and feature breakdowns update in real time.
Developer-first
No agents, no wrappers. Drop it into your existing LLM calls.
import { llmetrics } from "@llmetrics/sdk";
llmetrics.init({
apiKey: process.env.LLMETRICS_API_KEY,
});
// Call your LLM as normal...
const response = await openai.chat.completions.create({ ... });
// Then track it. Fire-and-forget.
llmetrics.track({
feature: "lesson-generation",
provider: "openai",
model: "gpt-4o-mini",
inputTokens: response.usage.prompt_tokens,
outputTokens: response.usage.completion_tokens,
});Supports 100+ models across OpenAI, Anthropic, and more — pricing synced daily.
Pricing
Start free. Upgrade when you need more.
Free to start. No credit card required. SDK setup takes under 5 minutes.
Get started for free →