Meter the agents.
Bill your customers.
A metered-billing engine built for agent platforms: metrics, plans, subscriptions, usage events, adaptive limit enforcement, and invoicing — with popular payment gates like Stripe as the payment rail and a vendor model that lets your customers bill their own users.
Read the docsUsage-based billing for agents is more than a Stripe integration.
You need immutable usage ledgers, per-metric limits with graceful degradation, proration, dunning policy, passthrough pricing for LLM costs, and a limit check that doesn't add a network hop to every request. Billing Server owns all of it — Stripe is strictly the payment processor, so subscription logic never lives in two places.
Metrics
Any measurable unit an application reports — API calls, messages per day, LLM dollars — with reset periods from per-minute to per-cycle, decoupled from the billing cycle. "100 messages/day on a monthly plan" is one config line.
Plans
Fully self-service: base price, billing period, prepaid/postpaid/hybrid, upgrade and cancellation behavior, failed-payment policy. Per-metric pricing supports included units, per-unit, graduated tiers, and passthrough — report actual cost, apply markup, built for variable LLM pricing.
Subscriptions
Link a subscriber — user or application — to a plan, possibly one owned by a different organization. Plan terms freeze into a snapshot at subscribe time: editing a plan never changes existing subscribers' terms.
Usage events
Immutable, append-only, idempotency-keyed (duplicates within 24h ignored), retained 7 years. Corrections are new negative events, never edits.
Adaptive limits
Unlimited, soft (tracked, notified), or hard (blocked) — plus conditional overrides: exhaust your daily quota and your per-minute rate tightens instead of cliffing. Apps cache effective limits and honor a server-computed recheck_after hint, so enforcement never sits in the hot path.
Invoicing
Generated per cycle with typed line items — base, usage, passthrough, adjustment — sequential numbering, permanent retention, simple daily-rate proration.
Stripe + Connect
Stripe holds card data (Elements — it never touches platform servers) and processes PaymentIntents. Connect onboards each vendor org as a connected account, so payments for a vendor's plans route to that vendor's Stripe account.
The vendor API
An authenticated application subscribes its own users to its own plans — the trust boundary is plan ownership, and end-user JWTs never reach the billing server. With auto-provisioning, a new user's first API call transparently creates a subscription.
From request to paid, with dunning built in.
THE METERING LOOP
Check — your app consults locally cached effective limits; at the recheck_after threshold it refreshes from the billing server — frequent when near a hard limit, rare when far.
Serve & report — the request processes; consumption posts as an idempotent usage event. Passthrough metrics report actual cost instead of units.
Adapt — soft-limit crossings fire webhooks; override triggers tighten related limits automatically and relax when the trigger metric resets.
Calculate — at cycle end: base price + per-unit charges + graduated tiers + passthrough costs with markup, minus included amounts.
Charge — a PaymentIntent runs against the stored method, routed to the vendor's connected account.
Confirm or dun — success marks the invoice paid; failure starts the vendor's policy — grace period, scheduled retries, past-due, suspension, optional auto-cancel — with webhooks to both parties at every transition.
Plans, subscriptions, usage, limits — plus the vendor surface.
Built like a ledger, because it is one.
Immutable usage — append-only, idempotent events; 7-year retention; invoices and billing events kept indefinitely.
Terms that don't shift — plan snapshots guarantee existing subscribers' terms survive plan edits.
PCI stays at Stripe — card data never touches platform servers — Elements and PaymentIntents keep it that way.
Tenant isolation — vendors see subscriptions to their plans, never subscribers' internal billing; all org scoping derives from the JWT, never user input.
Never in the hot path — cached enforcement with server-computed recheck intervals; cached limits keep serving if billing is briefly unreachable.
Every change attributed — an append-only billing event log with actor attribution, for disputes and audit; HMAC-signed outbound webhooks.
Pricing models that fit how agents actually cost.
100 messages/day soft; at 101, an override converts the per-minute metric to a hard 2/min. The user is slowed, not cut off — and it auto-clears at midnight.
An app reports cost $0.0847 per agent run; the plan bills actual cost plus 20% markup with the first $5 included.
15,000 API calls across $0.02 / $0.01 / $0.005 tiers bills exactly $135 — each rate applies only inside its tier.
An org building on AgentOS defines "Pro, $29/mo" for its own users. Payments route to its Stripe Connect account; its app auto-provisions each signup via the vendor API.
A $10 → $30 move with 15 of 31 days left nets a $9.68 prorated charge — plain daily math, no surprises.
Meter it once. Bill everywhere your agents run.
From usage event to paid invoice — Billing Server owns the whole path, so subscription logic never lives in two places.