Built for AI products

Track AI usage.
Bill it accurately.
Without rebuilding your stack.

UsageBox meters tokens, GPU minutes, agent runtime, and tool calls per customer. Open-source storage engine. Connects to Stripe or your own invoicing.

Idempotent
Ingestion
Immutable
Audit trail
Open source
Storage engine
POST /v1/events
curl -X POST https://api.usagebox.com/v1/events \
-H "Authorization: Bearer $UBX_KEY" \
-d '{
"event_id": "req_8x42jk",
"account_id": "acme-co",
"meter": "llm_tokens_in",
"model": "claude-4.5-sonnet",
"quantity": 12450,
"timestamp": "2026-05-16T18:42:11Z"
}'
 
# Idempotent. Retries are safe.
# Rolls up hourly. Invoiced via Stripe.

Why generic billing breaks on AI workloads

Stripe Billing, Chargebee, Recurly: built for SaaS subscriptions in the 2010s. AI usage is a different shape of problem.

Volume breaks generic billing

Stripe's metered usage assumes thousands of events per customer per month. AI products send millions per day. Generic tools throttle, fail silently, or charge you per-event.

Attribution needs a graph

An agent run is N tool calls + M LLM calls + K memory ops. Each costs different amounts. Generic billing tools can't roll those into a single billable unit without engineering work you keep redoing.

Attacks show up in the bill

A user can manipulate prompts to trigger expensive generations. Without per-user spend ceilings and real-time anomaly detection, the first sign of an attack is your AWS or OpenAI invoice next month.

Built for the way AI products actually meter

Six primitives. Each one designed for the AI billing patterns generic tools fight you on.

Token Metering

Meter LLM input + output tokens per request, per agent, per tenant. Idempotent ingestion handles retries without double-billing.

GPU Minute Pricing

Bill inference time, fine-tuning runtime, or per-job GPU usage. Catalog-driven pricing rules; no code changes to update rates.

Per-Agent Cost Attribution

Track cost for each agent run across N tool calls + M LLM calls + memory ops. Roll up to tenant invoices automatically.

Real-Time Anomaly Detection

Cost-amplification attacks land in your usage data first. Per-user spend ceilings, alerting on token surges, kill-switches.

Hourly Rollups

Raw events feed hourly aggregates. Invoice generation is O(1) per account, not a scan over millions of rows.

Stripe + Manual Invoicing

Plug into Stripe for self-serve. Or generate finance-ready invoices for enterprise contracts. Same metering pipeline.

The storage engine is open source

usagedb is the Rust storage engine UsageBox runs on. Append-only, idempotent, immutable raw event audit trail, hourly rollups for invoice queries. Apache 2.0 on GitHub.

Read the code that produces every invoice line. Fork it. Self-host the ingestion layer while still using UsageBox for the platform side. The right answer to “is your billing math correct” is “read the code yourself.”

pbudzik/usagedb

Or read the architecture overview in our usagedb article, then go deep with the 10-part engine internals series: ingest, dedupe, columnar segments, rollups, the query engine, and how it is tested.

Notes on AI billing

Practical writing on metering patterns, AI cost attribution, and what we learn from production billing systems.

ChatGPT Workspace Agents Now Bill Credits on Top of Seats: The July 6 Cutover Math (2026)

On July 6, 2026 the free preview of ChatGPT Workspace Agents ended: every agent run in a Business, Enterprise, or Edu workspace now draws down workspace credits on top of the per-seat fee. The published GPT-5.5 rates - 125 credits per million input tokens, 12.50 per million cached, 750 per million output - put a typical run at 5 to 25 credits, but OpenAI shipped the meter without a consumption table for real workflows, so teams that automated prospecting, reporting, or ticket routing during the free spring now carry a variable cost they cannot budget from the docs. The seat is the floor; the meter is the bill. The credit math worked through, the free-preview trap named, and the five things to meter (credits per run by agent, runs per workflow, invoker attribution, cache hit rate, spend alerts) to build the consumption table the vendor did not publish.

Read →

OpenAI Is Winding Down Fine-Tuning: The Deadlines, the 60-Day Trap, and the Migration Cost Math (2026)

OpenAI is closing self-serve fine-tuning in three steps: new orgs lost access May 7, 2026; since July 2 any org with no fine-tuned-model inference in the prior 60 days loses new-job creation; and on January 6, 2027 it closes for everyone. Existing fine-tuned models keep serving until their base model is deprecated. Two cost stories hide inside: the 60-day inactivity rule gates a platform capability on your own usage recency - making per-model usage monitoring into capability insurance - and migrating a fine-tuned workload back to a base model moves instructions out of the weights and into every prompt, growing per-call input several-fold while dropping the fine-tuned premium. Whether that trade is cheaper depends on your cache hit rate and cost per successful task, not per-token list prices. The full timeline, the monitoring lesson, and the measurement playbook to run before the January door closes.

Read →

Pass-Through, Markup, or Flat: How AI Products Decide to Rebill LLM Costs (2026)

Every product that calls LLMs on behalf of customers has exactly three ways to rebill the cost: pass-through at 1.0x, markup (cost-plus), or flat pricing that absorbs the variance. In July 2026 the decision went public - PostHog shipped an open pull request billing its Code product LLM usage as pass-through credits with explicitly no markup, breaking from its standard 20% AI margin, while flat per-call gateways and a $6/month unmetered API sell against metering itself. Each model is a different bet on trust, margin, and variance, and each puts a concrete requirement on the metering pipeline: pass-through needs perfect per-customer cost attribution (cache reads vs writes, retries, sub-agent fan-out), markup needs realized-margin telemetry, flat needs cohort economics and a fair-use kill-switch. The three models compared, the gray relay market that punishes undisclosed spread, and how to choose.

Read →

Start metering AI usage in 5 minutes

Free tier. No credit card. Open-source storage engine.

Get started free →