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.

The Fable 5 Usage-Credits Switch (July 20): the 50% Rule, the Math, and the July 17 False Alarm

Included Fable 5 access on Claude subscriptions ends July 19, 2026; from July 20 every Fable 5 token beyond the plan's included window bills as metered usage credits at the API rate - $10 per million input tokens, $50 per million output, exactly 2x Opus 4.8. During the included period Fable 5 could draw at most 50% of a plan's weekly credits (Pro's 200 weekly credits meant at most 100 on Fable). The switch got an accidental dress rehearsal on July 17, when a bug walled Fable 5 behind usage credits two days early - an 85-comment Ask HN, a please-reconsider GitHub issue, and a status-page fix at 18:48 UTC. The metered math at real volumes (one Max 20x subscriber burned ~$3,900 in credits in a month on Fable-tier orchestration, raising his cap 1,000 to 4,500), the subscriber limits-fatigue backdrop, and the four things to do before Monday: measure your Fable share, re-route the routine to Sonnet/Opus, set the credit cap calmly, and treat July 17's wall as your exposure assessment.

Read →

AI Credits Are the New Pricing Primitive: Three Cutovers in Seven Weeks (GitHub, OpenAI, Anthropic)

Between June 1 and July 20, 2026, GitHub, OpenAI, and Anthropic all moved flagship products onto credit-based metering: Copilot's AI Credits (1 credit = $0.01, token-based drawdown, completions free), ChatGPT Workspace Agents' credits-on-top-of-seats, and Fable 5's usage credits at $10/$50 per million tokens. Why credits won (a number that feels fixed over a meter the vendor controls per model), why per-seat broke first for agentic SaaS (a customer pays less as the AI does more - the r/SaaS inversion), and the operational tell that pricing is now production code: GitHub adding CI guards against pricing-catalog drift, and Anthropic shipping a pricing outage two days before its own switch. What buyers should do (budget from the metered rate, build the consumption table vendors won't publish) and what sellers should learn from the same vendors' mistakes.

Read →

Sonnet 5 Intro Pricing Ends August 31: The +50% Flip and the August Checklist

Claude Sonnet 5 launched June 30, 2026 at introductory pricing - $2 per million input tokens, $10 per million output, through August 31. On September 1 the standard $3/$15 rate takes over: a +50% flip on every Sonnet token, on the model that is now the Free/Pro default and the recommended everyday-agent tier. What the flip does to a real bill (a 1B-input/300M-output product goes from $5,000 to $7,500 a month), how the routing thresholds move (Haiku's discount doubles back to 3x; the Sonnet-to-Opus step-up narrows to 1.67x), the two levers that blunt it (batch's 50% keeps async work below today's intro rate; prompt caching cuts repeated context ~90%), and the four-item August checklist: re-forecast September at 1.5x, re-quote client work, re-run the Haiku eval on your highest-volume tasks, and set a September burn alert that fires only if you did nothing.

Read →

Start metering AI usage in 5 minutes

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

Get started free →