Token Meter SDKs
Know what each customer costs you to serve
Token Meter wraps the LLM client you already have, reads token usage off the response it already returns, and ships it to your dashboard tagged with the customer, feature, and team that caused it.
What it does
One call (wrap() in TypeScript, tokenmeter.wrap() in Python) patches the provider client you constructed yourself, so every call you already make keeps working exactly as it does today. Usage, latency, and any attribution tags active at call time (customer, feature, team, environment) are captured in-process and batched to the Token Meter Ingest API in the background. Every provider's usage shape is normalized into the same disjoint counter set, so cost math downstream is correct by construction instead of per-provider guesswork.
Two-line quickstart
Install, initialize, wrap. That's the whole integration for a raw provider client.
// Install with: npm install @tokenmeter/sdk
import OpenAI from "openai";
import { TokenMeterClient, wrapOpenAI } from "@tokenmeter/sdk";
const tl = new TokenMeterClient({ apiKey: process.env.TOKEN_METER_KEY! });
const openai = wrapOpenAI(new OpenAI(), tl);Continue with the full quickstart to add attribution and see the first event land.
What it is and isn't
It is not a proxy
The SDK never sits between your app and the provider. It reads usage from the response object after the provider has already answered. There is no extra network hop, and it cannot slow down, retry, rewrite, or block a call. If the provider call throws, that exception passes through untouched; Token Meter's own bookkeeping is the only thing wrapped in try/except.- Does: capture usage post-hoc, normalize it per provider, tag it with whatever attribution scope is active, and ship it async.
- Does not: add latency, add a network hop, block or slow a call, or ever throw an exception into your code.
The one exception is opt-in: governance preflight checks a direct call with the Router before it runs, so it adds a round trip and can stop the call.
See Reliability for the full set of guarantees and honest failure modes.
Beyond the SDK
The SDK is one way in. These guides cover the rest of the dashboard and how to set each part up.
- Coding agents: connect Claude Code, Codex, Cursor, Copilot and other coding tools and see usage per developer
- AI Bill: import what providers and clouds actually bill and see one total per month
- Router: meter OpenAI-compatible traffic by changing a base URL instead of code
- Gateway & routing: routing policies, fallbacks, caching, Recall, experiments and evaluations
- Governance & alerts: keys, budgets, guardrails, Shadow AI, the audit log, monitors, alerts and the Inbox
- Customers & clients: margin per customer, projects, clients and the client portal
- AI Impact: tie AI spend to pull requests and tickets with GitHub and Jira
- Workspace admin: plans, roles, people, teams and business units