Billing scaffold

The Stripe wiring that subscription billing will be built on. Today it is plumbing: a lazy Stripe client and a webhook endpoint that verifies signatures — no tiers, no checkout, no seat management yet.

Walkthrough — Billing scaffold

What it is

  • SurfacesPOST /api/stripe/webhook (signature verification plus a customer.subscription.* event switch, cases currently empty) and the stripe() client factory.
  • Codesrc/lib/stripe.ts (the lazy client — instantiated on first use, not at module load) and src/app/api/stripe/webhook/route.ts (runtime = "nodejs").

The pricing model

Pure BYOK

The pricing model is seat-based and bring-your-own-key: the customer's model API key bills the customer directly. It is explicitly not pass-through token reselling, and there is no usage or token metering. Every feature must leverage the customer's own LLM key.

Why it matters

Indirectly today — it is the revenue plumbing. Once tiers land, it is how a team buys seats and manages its subscription. The forensic angle: billing state changes are themselves auditable events — provisioning a seat will be a row in the ledger.

Last updated