docs / guides

Passthrough billing

Bill each of your customers for the AI usage they caused, plus your markup, through your own Stripe account.

noburn already measures what each of your end users spends on AI, as long as you pass endUserId / end_user_id to check() and record(). Passthrough billing turns that into a line on each customer's next Stripe invoice, with your markup on top, so heavy users pay for what they use.

Charges are created in your Stripe account, with a restricted key you create there. noburn never holds a full secret key, and you can revoke access at any time from your Stripe dashboard.

Passthrough billing is part of the Pro plan. On other plans the panel links to an upgrade, and the API answers 402 with code PLAN_LIMIT_EXCEEDED. If your organisation leaves Pro, billing stops from the next run; your key and mappings stay stored, and you can still remove them.

1. Create a restricted key in Stripe

In your Stripe dashboard, go to Developers → API keys → Create restricted key and give it exactly two permissions:

PermissionAccessWhy
Invoice itemsWriteto add each customer's usage to their next invoice
CustomersReadto check the key and the customers you map

Leave everything else at None. Create it in test mode first if you want to try it out: a test key (rk_test_…) bills test customers only.

2. Add the key and your markup

On your project page, open Passthrough billing (Stripe):

  1. Paste the key and click Save key. noburn checks it against Stripe before saving: a key that can't read customers or invoice items is refused with the permission it's missing, and a full secret key (sk_…) is refused outright.
  2. Set your markup as a percentage. 20% bills a customer who used $10 of AI $12.00.

The key is stored encrypted and never shown again. The panel only shows its last four characters and whether it's live or test.

3. Map end users to Stripe customers

For each end user you want to bill, enter their end_user_id (the one you pass to noburn) and their Stripe customer id (cus_…) from the same Stripe account as the key. End users without a mapping are never billed.

When and how billing runs

  • Once a month, for the previous calendar month (UTC). The billing job runs daily at 05:00 UTC. Each end user is billed once per month, however many times the job runs, so a missed day is simply picked up the next day.
  • What's billed: the end user's AI spend that month (calls noburn refused aren't counted) × (1 + markup), rounded to the cent. Amounts under 1 cent are skipped.
  • Where it appears: as a pending invoice item on that Stripe customer, described as AI usage, October 2026, with noburn_project_id, noburn_end_user_id and noburn_period_start in its metadata. Stripe adds it to the customer's next invoice: their next subscription invoice, or the next invoice you create for them. noburn never creates or charges an invoice by itself.
  • Currency: USD.
  • Run it by hand: Run billing (prior month) on the panel runs the same job for this project now. It reports how many customers got a line, how many were already billed for that month, and how many were skipped.

If Stripe rejects the key

If the key is revoked or loses a permission, the next run stops, noburn deletes its copy, and the panel asks for a new key. Nothing is billed until you add one.

To stop billing yourself, click Remove key on the panel, and revoke the key in Stripe too.

What noburn stores

The encrypted key, its last four characters, your markup, the end_user_id → cus_… mappings, and a record of which end user was billed for which month and how much. noburn never sees prompt or completion text.

On this page