Which customers
lose you money.
What each customer costs against what they pay. Every AI call gets a price, an owner and a place in that customer's month.
Free up to 1M events a month. No card.
Follow one call
to a customer's month.
Providers' bills don't say which of your customers a call was for. You add that at the call.
req_7f3a91gpt-4o1,204 in312 out$0.006130Every customer, revenue
against cost to serve.
A customer appears as soon as usage tagged with its reference arrives. There is no list to create first.
A margin that says
how far to trust it.
Margin is revenue minus the customer's AI cost for the month. Your metered cost is compared with your providers' bills, and the margin is labelled with one of three states.
One figure.
Billing was reconciled for the month, and metered cost is within 2% of the bill.
Two ends.
Metered cost and the bill differ by more than 2%. One end assumes none of the gap is this customer's, the other that all of it is.
One figure, never called confirmed.
No reconciliation has run for the month, or the metered and billed totals are too far apart to compare.
Tag once.
Every call inside follows.
Works in TypeScript and Python. Usage is reported in the background.
Name the customer and feature once. Every call inside gets that tag.
Revenue is one number per customer per month, in USD. Type it for one customer, or import rows for many at once. It is not read from a billing system. Paid plans
import OpenAI from "openai"; import { TokenMeterClient, wrapOpenAI, action } from "@tokenmeter/sdk"; const tl = new TokenMeterClient({ apiKey: process.env.TOKEN_METER_KEY! }); const openai = wrapOpenAI(new OpenAI(), tl); await action("generate-report", { customerRef: "acme", feature: "reports" }, async () => { await openai.chat.completions.create({ model: "gpt-4o-mini", messages }); // tagged customer_ref=acme, feature=reports });
from openai import OpenAI from tokenmeter import TokenMeterClient, wrap_openai, action tl = TokenMeterClient(api_key=os.environ["TOKEN_METER_KEY"]) client = wrap_openai(OpenAI(), tl) with action("generate-report", customer_ref="acme", feature="reports"): client.chat.completions.create(model="gpt-4o-mini", messages=messages)
acme or cus_1042. A value that contains an email address, a phone number, a card number or something that looks like an API key is stored as a keyed pseudonym, never as sent.From one request
to the whole month.
The same tags that fill the customer's month also split spend by feature and team, and show which calls are missing an owner.
Customer margins,
in short.
Tags, revenue and margin are covered step by step in the docs.
Customers docs →01Do my calls go through your servers?
No. The SDK wraps the client you already use, reads usage from the response it returns and ships it in the background. The router is a separate choice, for when you want routing, fallbacks and caching.
02Where does revenue come from?
You enter it. Revenue is one number per customer per month, in USD: what you charge the customer. Type it on the customer's page, or import rows of customer reference, month and revenue for many customers at once.
03Why is a margin shown as a range?
Because metered cost and the provider's bill differ by more than 2% for that month. One end of the range assumes none of the gap belongs to this customer, the other that all of it does.
04What about calls with no customer tag?
Usage without a customer still counts in every other total. It just isn't listed under a customer. Data health shows which calls are missing a customer, a feature or a price.
Every AI bill,
in one place.
What your team's tools spend, what your customers cost, whether it matches the bill, and what to do about it.