Billing infrastructure for AI companies

Know what every customer
actually costs you.

Subscriptions, metering, entitlements, dunning — plus true unit cost per customer across your AI and infra stack. One SDK, no hard-coded billing logic. Stripe is just the rail underneath.

app.ts
import nozle from '@nozle/sdk';

const nz = new nozle(process.env.NOZLE_KEY!);

// 1. Subscribe a customer to a plan
await nz.subscriptions.create({
  customer_id: 'cus_acme',
  plan_id:     'pro_monthly',
});

// 2. Meter what they use (AI, infra, anything)
await nz.events.track('gpt-4o', {
  input_tokens:  3_240, output_tokens: 1_180,
  customer_id:   'cus_acme',
});

// 3. Invoice + true unit cost — handled.
// → revenue $49.00 · cost $12.40 · margin 74.7%
Live · Acme Corp 74.7%+2.1pp margin
Top burner
Initech
−78%
margin
Claude Sonnet 4.6 $64.00
OpenAI embeddings $21.06
Lambda inference $14.10
True margin
Acme Corp
74.7%
across all products
Revenue lies. Margin doesn't.
Every customer has a true margin. Most billing tools never compute it — so you ship plans that look profitable and quietly aren't.
Initech pays you $42.
Serving them costs $108.
You lose $66 every month they stay on the Pro plan — and the gap widens as they use more.
Revenue $42.00
True cost $108.00
Net −$66.00

Every event lands in one shared record.

Finance, product, and ops all read the same number. Subscriptions, usage, and cost write to the same timeline — append-only, so nothing is rewritten or lost.

Subscriptions
Plans, proration, dunning, trials, coupons, multi-currency — declared as data, not if-statements.
Metering
LLM tokens, embeddings, vector queries, compute milliseconds, storage GBs, sends, transactions — all attributed to the customer who triggered them.
Real-time margin
Revenue minus cost, inline, as each event lands. Not end-of-month. Not a spreadsheet. Right now.
Some customers print money. Others quietly bleed it.
Healthy — fat margin
Comfortable — room to grow
Thin — watch closely
Marginal — barely paying
Underwater — you pay them

Meter. Bill. Attribute cost.

01
Every event, in real time.
Meter, gate, and bill from one stream — no batch jobs, no reconciliation lag. Metering, entitlements, and wallets run in the hot path.
02
Pricing as configuration.
Plans, proration, and dunning declared as data — change a tier without a deploy. Run an experiment without a migration.
03
Margin, not just revenue.
The engine that bills the customer also knows what they cost — margin becomes a query, not a quarterly reconciliation.
SDK · TypeScript
// Meter any event
await nz.track('claude-sonnet-4', {
  input_tokens:  3_240,
  output_tokens: 1_180,
  customer_id:   'cus_acme',
});

// Response — cost + margin inline
{
  id:        "evt_01HNX…q2",
  cost_usd:  0.0428,
  margin_usd:0.1572,
  customer:  "cus_acme",
  received_at:"2026-04-26T14:02:11Z"
}

// → Cost & margin computed inline.
// ✓ typed · ✓ idempotent · ✓ replayable
Typed end-to-end Webhooks you can debug Local dev, no mocks
Pluggable payment rails
Stripe Razorpay Adyen Cashfree + adapters
The processor is dumb plumbing — swap or route per region. Build on nozle. Swap rails underneath.

Ten strategies, ready out of the box.

Mix, match, or switch — without rewriting your billing code. Plus trials, coupons, grandfathering, multi-currency, minimum commits, averages, proration, dunning, and wallets.

01
Flat subscription
One product, one price — predictable, blind to load.
02
Tiered subscription
Three or four plans, each gating features and caps.
03
Per-seat
Charge per active human user.
04
Pure usage
Pay-as-you-go — per request, token, or event.
05
Tiered usage
Per-unit rate steps down as volume crosses bands.
06
Prepaid credits
Top-up wallets burned across any feature.
07
Base + usage
Platform fee plus metered overage above an included pool.
08
Seats + usage
Per-seat platform plus per-action consumption.
09
Per-action (agentic)
Bill per resolved task — agents, not seats.
10
Outcome-based
Bill on realised value: a take-rate on results.
15 min setup
5 SDKs
0 glue code
$0 until $10k MRR
Stop guessing.
Start knowing.

Wire NozleOS into your stack and watch the first margin report land before your coffee gets cold.

48h
time to first live plan
90s
from npm install to first event
p99 113ms
99.99% uptime · 14 regions