JSONL log, CLI, and MCP server. Wrap your provider client. No account required.
Get started → Open the full analyzer View on npm Free API
Zero install, zero signup. Try the live calculator below, paste a full log into the analyzer, hit the free API, or install the SDK. See pricing across 13 LLM models →
Tweak the model, tokens, and call volume — all 13 supported models, math runs in your browser. Same widget any dev blog can embed in two lines (see /embed).
npm install tokenmarkcompute_cost $0.001/eventlist_pricing freeHosted-tier subscription with team views, retained history, and budget alerts coming after billing rail goes live. Compare LLM API pricing across 13 models →
Token spend is 30–60% of any AI app's variable cost. Knowing where it goes — per provider, per model, per user, per call — usually requires committing to a full observability platform. tokenmark sits before that commitment: drop-in middleware that writes every LLM call to a local JSONL file, queryable by CLI or via MCP for autonomous agents.
If you outgrow it, the data is already in the open format your future platform wants. If you don't, it stays local and private.
npm install tokenmark
# In your code:
import Anthropic from "@anthropic-ai/sdk";
import { wrapAnthropic } from "tokenmark";
const client = wrapAnthropic(new Anthropic());
const msg = await client.messages.create({
model: "claude-haiku-4-5",
max_tokens: 1024,
messages: [{ role: "user", content: "Hello." }],
});
// → call logged to ./tokenmark.jsonl with cost, tokens, latency
# Read the log:
npx tokenmark report --since 7d --route-recommendations
{
"mcpServers": {
"tokenmark": {
"command": "npx",
"args": ["-y", "tokenmark-mcp"]
}
}
}
Tools available: list_calls, get_spend_summary, get_top_costly_calls, get_route_recommendations.
The same analysis is available as a hosted Apify Actor — POST your JSONL log (or array of call entries) and get back a spend summary, top costly calls, and rule-based route recommendations. Pay-per-event pricing, no signup beyond Apify's marketplace.
| Provider | Models | Coverage |
|---|---|---|
| Anthropic | claude-opus-4-7, claude-sonnet-4-6, claude-haiku-4-5 | input + output + cache |
| OpenAI | gpt-5, gpt-5-mini, gpt-5-nano | input + output + cache-read |
| gemini-2.5-pro, gemini-2.5-flash | input + output | |
| Groq | llama-3.3-70b-versatile, llama-3.1-8b-instant | input + output |
| Together AI | llama-3.3-70b-instruct-turbo, qwen-2.5-7b-instruct-turbo, deepseek-v3.1 | input + output |
Pricing table cites source URLs + last-verified dates. Unknown models log cost_unknown: true rather than silently zeroing. See head-to-head pricing across all 13 models →
This SDK does not transmit prompt content, completion content, system prompts, tool calls, or any user data by default. The default sink is a local file under your control. The HTTP sink is opt-in to a URL you provide. There is no analytics, telemetry, or phone-home.