Multi-tenant billing

Per-tenant, per-end-user AI billing on Stripe.

Stop eating AI cost on your card. odnoga attributes every dollar to a tenant and an end user, rolls it into one Stripe invoice across every vendor, and lets you price it however you want.

One header. Every call attributed.
await fetch("https://api.odnoga.com/v1/chat/completions", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    Authorization: `Bearer ${KEY}`,
    "x-airouter-end-user": "tenant_acme:user_42",   // <- attribution, not yet a charge
  },
  body: JSON.stringify({
    model: "gpt-5.1",
    messages: [{ role: "user", content: "Hello" }],
  }),
});
What it takes

From a header to money in your account

Attribution is one header. Collecting the money is five steps, and you do them once.

  1. 1

    Connect Stripe

    Your own Stripe account, with a restricted key — Customers, Checkout Sessions, Billing Portal and Meter events write, Subscriptions read. Nothing else. odnoga verifies the key against Stripe before storing it, so an under-permissioned key fails here rather than at a customer’s checkout page. With those five it cannot create a charge, refund one, read your balance or move money.

  2. 2

    Attribute the usage

    Send x-airouter-end-user from your server, derived from the caller’s verified token so it cannot be forged. For browser calls, mint a short-lived eut_ token that binds the id server-side. This is the header above, and on its own it produces a metered record — not an invoice.

  3. 3

    Configure prices and the webhook

    Define your subscription tiers and map each to its Stripe price ids. Add odnoga’s webhook endpoint in Stripe and save the signing secret back, so subscription and payment events reach your account. List the hostnames allowed in your success and cancel URLs.

  4. 4

    Test it in test mode

    A test Stripe key puts the whole flow in test mode — plans, prices, customers and subscriptions are scoped separately, so the same plan can carry different price ids in test and live. Run a checkout end to end before a real customer does.

  5. 5

    Activate

    Swap in your live key. End-user billing is part of Growth and above — it is not available on the free plan, so this is the step that needs a subscription.

The full contract — permissions, events, error codes and a working example — is in the end-user billing guide.

Per-end-user attribution

One header — x-airouter-end-user — tags and meters every request against that customer. Attribution is what makes a charge possible; collecting it still takes the Stripe setup below.

Tenant Stripe accounts

Each tenant connects their own Stripe customer. You don't move money through your books.

One consolidated invoice

OpenAI + Anthropic + Gemini + Replicate roll up into one Stripe invoice per period.

Plans you create in-app

Build pricing tiers — fixed fee, included usage, overage rates — without code.

Budgets & limits per axis

Daily / monthly caps per tenant, per end user, per model. Soft caps warn; hard caps stop.

Audit-ready

Every dollar traces back to a request, a tenant, an end user, a prompt version and a provider.

FAQ

Frequently asked

Do I need to integrate Stripe myself?

You connect your own Stripe account and add one webhook endpoint; odnoga does the rest — creating customers, starting checkouts, reading subscriptions and reporting metered usage. You build pricing in the dashboard, not in code. What you do not do is write the Stripe integration.

Can I price by request, token, dollar of cost, or fixed tier?

All four. Plans support fixed fees, included usage allowances and overage rates measured in tokens, requests or pass-through cost.

What about chargebacks across vendors?

odnoga sees every provider call cost in real time, so the consolidated invoice you bill your tenants is always reconcilable against what you paid OpenAI, Anthropic, Gemini, etc.

Is the end_user header trustworthy?

Send it only from your server or Edge Function, derived from the caller's verified JWT — then your end user can't forge it. For browser calls, mint a short-lived eut_ token that binds the end-user id server-side.

Turn AI cost into recurring revenue.