A Token P&L for your AI agents — see what every call cost, which agent burned it, and what to cut.

TokenDam reads a trace and shows the % of tokens that did no real work, the spend broken down per agent/step, and 12 waste patterns — each with a dollar figure and a paste-ready fix. Drop tokendam --ci in your pipeline to fail the build when token cost regresses. Runs in your browser; nothing you paste is uploaded, and it never touches your request path. No SDK swap, no gateway, no routing your prod traffic through anyone.

trace.json — tokendam
~/agent $

# reads: openai · anthropic · langsmith · langfuse · vercel-ai-sdk · batch · raw logs

No setup — see what a report looks like.
Not a developer? Start here.
  1. Click See a live example above — that's what a report looks like, in ~2 seconds.
  2. To get your own numbers, forward this page to whoever manages your AI integration. It takes them about two minutes. You can copy the note below:
Hi — can you run our LLM requests through tokendam.dev? Paste a few real
request payloads (or a captured trace) and send me back the report / the
"report for your boss (PDF)". Trying to see where we can cut our AI bill.
~/agent $ tokendam --help # how do I get my trace?

Capture a few calls from one agent run — caching, history & duplicate-doc waste only show across multiple calls.

// easiest: the capture helper (any SDK)
import { tap, writeTrace } from "tokendam/capture";
await openai.chat.completions.create(tap({ model, messages, tools }));
await writeTrace("trace.json");   // then paste trace.json here

# — or log the request args yourself —

raw openai sdk

const params = { model, messages, tools };
console.log(JSON.stringify(params));
// paste it — or wrap several as [p1, p2, ...]

raw anthropic sdk

const req = { model, system, messages, tools };
console.log(JSON.stringify(req));
// reads your cache_control markers directly

vercel ai sdk

const openai = createOpenAI({
  fetch: async (url, init) => {
    console.log(init?.body);
    return fetch(url, init);
  },
});

langchain / langsmith

from langsmith import Client
print(Client().read_run(run_id).inputs)
# paste the JSON, or a run / array of runs

How this fits

tokendamproxies & gateways
(tokenwise, openrouter, portkey…)
setuppaste a trace — zero integrationroute your prod traffic through them
what you geta Token P&L + a CI gate that fails the build on regressionsa runtime dashboard of live traffic
sees your promptsnever — runs in your browseryes — sits in the request path
best forauditing & fixing waste at the sourceongoing routing / failover / caching

Use TokenDam to find and fix the waste in your prompts; reach for a gateway when you want to route traffic. Complementary — TokenDam just doesn't ask you to trust it with your data.

For engineers — why not just ask an LLM "where am I wasting tokens?"

You can — and it'll give you a plausible opinion. TokenDam gives you a measurement: exact tokenizer counts × current prices = a dollar figure you can trust, the same answer every time, for free, without sending your prompts to anyone. That's what lets it live in CI with a pass/fail budget and a tokendam diff regression gate — you can't put "paste it into Claude and hope" in a pipeline. Think ESLint, not "ask an AI to review my code."

● client-side — nothing you paste is uploaded o200k tokenizer privacy Fair Source