BillingEXECUTION WORLD · METERED VALUE

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 docs
THE PROBLEM

Usage-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.

HOW USAGE BECOMES AN INVOICE

From request to paid, with dunning built in.

THE METERING LOOP

01

Checkyour 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.

02

Serve & reportthe request processes; consumption posts as an idempotent usage event. Passthrough metrics report actual cost instead of units.

03

Adaptsoft-limit crossings fire webhooks; override triggers tighten related limits automatically and relax when the trigger metric resets.

04

Calculateat cycle end: base price + per-unit charges + graduated tiers + passthrough costs with markup, minus included amounts.

05

Chargea PaymentIntent runs against the stored method, routed to the vendor's connected account.

06

Confirm or dunsuccess 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.

API SURFACE

Plans, subscriptions, usage, limits — plus the vendor surface.

GET/api/plansList discoverable plans (respects visibility)
POST/api/subscriptionsCreate a subscription
PATCH/api/subscriptions/:idUpgrade / downgrade with proration
POST/api/usageReport a usage event — idempotent
GET/api/usage/summaryCurrent-period usage summary
GET/api/limitsEffective limits + recheck_after hint
GET/api/invoicesInvoice history
POST/api/payment-methodsAdd a card via Stripe setup intents
POST/api/service/subscriptionsVendor API: subscribe on behalf of your user
GET/api/service/subscriptions/checkVendor API: check an active subscription
GUARANTEES

Built like a ledger, because it is one.

Immutable usageappend-only, idempotent events; 7-year retention; invoices and billing events kept indefinitely.

Terms that don't shiftplan snapshots guarantee existing subscribers' terms survive plan edits.

PCI stays at Stripecard data never touches platform servers — Elements and PaymentIntents keep it that way.

Tenant isolationvendors see subscriptions to their plans, never subscribers' internal billing; all org scoping derives from the JWT, never user input.

Never in the hot pathcached enforcement with server-computed recheck intervals; cached limits keep serving if billing is briefly unreachable.

Every change attributedan append-only billing event log with actor attribution, for disputes and audit; HMAC-signed outbound webhooks.

IN PRACTICE

Pricing models that fit how agents actually cost.

GRACEFUL THROTTLING

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.

LLM COST PASSTHROUGH

An app reports cost $0.0847 per agent run; the plan bills actual cost plus 20% markup with the first $5 included.

GRADUATED TIERS

15,000 API calls across $0.02 / $0.01 / $0.005 tiers bills exactly $135 — each rate applies only inside its tier.

CUSTOMER-AS-VENDOR

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.

MID-CYCLE UPGRADE

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.