Use case

Meter AI usage per customer — so you can bill them accurately

You resell AI. Now you have to bill for it.

You built a product on top of OpenAI, Anthropic, or Google, and you charge your own customers for the AI it uses. To bill them fairly — usage-based pricing, COGS-based margins, or just a monthly true-up — you need to know exactly what each end customer consumed: their tokens and their cost, attributed accurately to them.

The provider invoice can't help. It gives you one lump sum for your whole account — it has no idea that some of those tokens were customer A and some were customer B. Without a per-customer breakdown, you're either guessing at allocation or eating the cost.

Tag each request with the customer; TOLVYN meters the rest

Route your provider calls through TOLVYN and tag each request with the end customer it belongs to — one header, X-Tolvyn-End-Customer, or set it once in the SDK. From there TOLVYN does the metering and attribution:

  • Meters provider-reported tokens. Token counts come from the provider's own reported usage (input, output, and cached), not a guess.
  • Computes cost in microdollars. Cost is derived from those token counts and current model pricing using exact decimal arithmetic — no floating-point drift.
  • Attributes per end customer. Every request's cost is recorded against its customer tag.
  • Breaks it down. The dashboard has a per-end-customer view — spend, token usage, and AI cost-of-goods-sold per customer — and the usage data exports to CSV.

That CSV (or the API behind it) is the per-customer usage record you feed into your own billing — the numbers you turn into your customers' charges.

Important: TOLVYN meters, it does not bill

TOLVYN is a metering and attribution layer — not a billing system. It produces accurate per-customer usage and cost data. It does not issue invoices, collect payments, manage subscriptions, or run usage-based-billing automation for your customers.

You keep your own billing stack — Stripe, Chargebee, a custom invoicing flow, whatever you already use — and feed TOLVYN's per-customer numbers into it. TOLVYN answers "what did each customer consume and what did it cost?"; your billing system turns that answer into an invoice and charges the card. Clean separation: we do the meter, you do the money.

How it works

Proxy Tag per customer Meter Attribute Breakdown + CSV You bill
  • Proxy. Point traffic at TOLVYN — one base-URL change or a drop-in SDK (Python, Node, Go).
  • Tag per customer. Add X-Tolvyn-End-Customer to each request to mark which customer it serves.
  • Meter. Provider-reported tokens, cost in microdollars via exact decimal math.
  • Attribute. Cost is stored against the customer tag — metadata only, prompts and responses are never stored.
  • Breakdown + CSV. Read the per-end-customer view, or export the usage to CSV / pull it from the API.
  • You bill. Feed those numbers into your own billing system to invoice and charge.

Honest caveats

  • Tagging is required. A request that arrives without X-Tolvyn-End-Customer is still metered, but rolls up to your organization total as unassigned — it won't appear under a customer until you tag it. Set it once per request path.
  • Metadata only. TOLVYN records model, tokens, cost, and your tags — never prompt or response content.
  • Cost is computed, not copied from the provider's invoice. The per-customer cost is TOLVYN's calculation from provider-reported token counts and current model pricing. It's the accurate basis for what you charge customers — but it is not a line-item reproduction of your provider's own bill. (Provider-reported tokens always win over estimates; estimation is only used if a provider omits usage on a streamed response.)

Start metering per customer

Tag your traffic by customer and the per-customer numbers are there from the first request. Free to start — 10,000 requests a month, no card required.