How to · B2B

AI Cost Per Tenant: Allocation and Chargeback for B2B SaaS

By Ghiles Asmani, founder of Weckr · Published August 15, 2026

Short version: in a B2B product, the commercial unit is the tenant, and your provider bill knows nothing about tenants because every account calls through your one API key. Allocation exists only if you tag each call with the tenant id when you make it. Do that, and three hard conversations become arithmetic: which accounts are profitable at their contract price, what renewals and seats should cost, and where usage tiers belong. Skip it, and a 10x spread in per tenant cost hides inside one invoice.

Why tenant allocation cannot come from the provider

Provider reporting stops at your organization, projects, and keys, the grain covered in the OpenAI Usage API guide and the Anthropic Admin API cost report. One key per tenant looks tempting and does not scale: key sprawl, rotation pain, and rate limits fragmenting per key. The standard answer is attribution in your own request path, the same move as tracking AI costs per user, with the identifier chosen for the B2B grain.

The composite tag pattern

One field carries both grains, rolled up in either direction:

await wk.chat(openai, {
  model: 'gpt-5.4-mini',
  messages,
  userId: `${tenant.id}:${user.id}`,   // tenant grain + seat grain
  feature: 'contract-analysis',
  plan: tenant.plan,                     // the tenant's contract tier
});

Tenant rollup answers the commercial questions, per seat detail answers the operational ones (which seat, which integration, which feature drives it). Keep identifiers opaque, tenant and user database ids rather than names or emails, both for hygiene and because tracking APIs like Weckr’s reject identifiers that look like PII, per what an AI cost tracker sees and never sees.

What the numbers unlock commercially

  • Account profitability: contract price minus measured AI cost per tenant, the B2B version of calculating margin per user. Expect a wide spread; the point is knowing which side of it each logo sits on before renewal, not after.
  • Pricing with a floor: real per tenant cost distributions tell you what seats must price at and where included quotas should end. Unlimited AI clauses get priced instead of gambled.
  • Overage conversations with receipts: when one tenant is 10x the median, you have the graph, per feature, per month. That conversation goes very differently with data.
  • Tenant level caps: a spending cap on the tenant identifier means no single account can consume your margin, enforced before the call, with downgrade as the soft option, the mechanics of per user spending caps at the account grain.

FAQ

How do I allocate AI costs per tenant in a B2B SaaS?

Tag every model call with the tenant identifier at request time, log the token counts against it, and price them at current rates. The provider cannot do it for you: all tenants share your API key, so the allocation only exists if your code records it. Once tagged, cost per tenant per month is a query, and chargeback or seat pricing decisions become arithmetic.

Should I allocate by tenant, by user, or both?

Both, hierarchically. Tenant level answers the commercial questions: is this account profitable at its contract price, what should renewal cost. User level within a tenant answers the operational ones: which seat is driving the spend, is one integration looping. A composite tag like tenant id plus user id gives you both from one field, rolled up in either direction.

What is AI chargeback and do I need it?

Chargeback means passing measured AI costs to the tenant that caused them, either as internal accounting or as actual billing line items like usage tiers and overages. You need it the moment tenant usage varies widely, which in AI products is immediately: a 10x spread in per tenant AI cost on identical contracts is normal, and flat pricing across that spread means your biggest logos may be your least profitable accounts.

How does per tenant cost change enterprise deal pricing?

It replaces guesswork with a floor. Knowing that similar tenants cost between $80 and $900 a month in model spend tells you what a seat must price at, what a fair included quota is, and where usage tiers should start. Sales conversations about unlimited AI get much easier when you can price the risk instead of absorbing it blind.

Can I set spending limits per tenant?

Yes, and for B2B it is often the right grain: cap the tenant, not the individual seat, so one account cannot consume your margin however its usage is distributed internally. Weckr enforces caps against the identifier you pass, so using a tenant scoped identifier gives you tenant level caps that block or downgrade before the call, with per seat visibility preserved underneath.

Keep reading

Know your accounts like you know your invoice

Weckr turns the composite tag into a live per tenant margin view: cost, revenue, and margin per account and per seat, caps enforced at whichever grain you choose, from two lines of integration. See the breakdowns on the live demo, or start with the AI cost and margin guide.

See the dashboard with real data, no signup needed.

Try the demo →