Built for AI products

Own your usage meter.
Keep billing portable.
Without re-instrumenting your product.

UsageBox records billing-grade usage events, deduplicates retries, handles late events, and produces explainable monthly rollups for the biller you already use.

Idempotent
Ingestion
Raw events
Retained
Late events
Event-time aware
POST /api/v1/usage
curl -X POST https://api.usagebox.com/api/v1/usage \
-H "x-api-key: $UBX_KEY" \
-H "Idempotency-Key: req_8x42jk" \
-d '[{
"meter": "meter.llm-tokens-in",
"value": 12450,
"timestamp": "2026-05-16T18:42:11Z"
}]'
ย 
# value is the only required field.
# Send Idempotency-Key and retries are safe.
# Rolls up per meter. Bill it downstream anywhere.

Why usage metering deserves its own layer

The difficult part is not drawing an invoice. It is preserving a trustworthy quantity through retries, delays, model changes, and billing-vendor changes.

Retries are normal

Collectors and application servers retry. A billing-grade meter has to make at-least-once delivery safe rather than turning network behavior into extra usage.

Usage arrives late

Queues stall, workers reconnect, and batch jobs report after the fact. Event time and ingest time are different facts, and billing needs to preserve both.

Your meter should outlive your biller

Payment and billing vendors change. Keeping raw usage and rollups in an independent layer lets you replace downstream billing without re-instrumenting the product.

The metering primitives you need before billing

UsageBox deliberately stops before monetary rating and invoicing. Its job is to make the quantity feeding those systems trustworthy.

Idempotent Ingestion

Send usage with an Idempotency-Key and retry safely. UsageBox scopes deduplication to your account so transport retries do not become usage.

Flexible Metering

Meter tokens, API calls, jobs, bytes, seats, or any numeric or unique signal using sum, count, max, and unique-count aggregation.

Late Events

Backdated and out-of-order events fold into the period where they happened instead of whichever month the collector finally delivered them.

Raw Event History

Keep the event that produced each aggregate so usage disputes can be investigated from source data instead of an opaque invoice total.

Monthly Rollups

Read compact per-subscription, per-item, per-meter, per-charge quantities without rescanning every raw event for normal billing workflows.

Biller Independent

UsageBox stops at trustworthy quantities. Feed those rollups to Stripe, Lago, your ERP, or your own invoicing code without moving the meter.

The next storage engine is open source

usagedb is the Apache-2.0 Rust storage engine being developed for UsageBox. Production UsageBox currently keeps Firestore authoritative while usagedb runs as a shadow path until equivalence and recovery requirements are proven.

Read the engine as it develops, fork it, and follow the design decisions around ingestion, deduplication and rollups. The production boundary is intentionally explicit: usagedb is not yet the authoritative UsageBox store.

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.

AI API Billing in 2026: Tokens, Credits, Requests or Outcomes?

The unit you measure and the unit you bill are not the same unit, and collapsing them is what makes AI pricing impossible to change later. What each of the four units really costs to implement, where each one breaks, what outcome pricing actually requires, and the architecture that lets you switch between them without re-instrumenting your product.

Read โ†’

Stripe Legacy Usage Records Are Dead: The Meter Events Migration

Stripe removed usage records in API version 2025-03-31.basil. Pinning to acacia works but freezes you out of everything since. The migration is not a URL swap: usage records were keyed on a subscription item and supported an absolute set action, meter events are keyed on the customer and only aggregate โ€” which makes set a code change, not an integration change.

Read โ†’

Orb Alternatives in 2026: After the $335M Adyen Acquisition

Adyen closed its acquisition of Orb on 1 July 2026 and runs it under an incubator model, so nothing breaks today. The sentence to read carefully is that multi-PSP support "continues initially". Metronome, Lago, Flexprice, OpenMeter, Amberflo and Chargebee compared, plus how to tell whether you actually need to move.

Read โ†’

Start metering AI usage in 5 minutes

Free tier. No credit card. Meter first; choose your biller separately.

Get started free โ†’