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.

Gemini 3.8 Flash Pricing & Free Tier (October 2026)

Gemini 3.8 Flash is free on the Gemini API Free Tier and costs $0.75 input and $3.75 output per 1M tokens through December 31, 2026, doubling to $1.50 and $7.50 on January 1, 2027. Batch, Flex and Priority prices, free tier rate limits, spend limits, and cost examples.

Read โ†’

Gemini CLI Free Tier Limits 2026: 1,000 Requests a Day

Gemini CLI limits by sign-in method as of October 2026: 1,000 requests a day with a Google account, 250 a day (Flash only) with an unpaid API key, 1,500 to 2,000 on paid plans. What counts as a request, which plans are not supported, and what pay-as-you-go costs.

Read โ†’

OpenAI Codex Pricing & Usage Limits (October 2026): Every Plan

OpenAI Codex pricing as of October 2026: Free, Go $8, Plus $20, Pro from $100, Business $20 per user, and API key billing. Local messages per five hours by model, Fast and Ultrafast multipliers, credit rates per 1M tokens, and the GPT-5.5 retirement on October 14.

Read โ†’

Start metering AI usage in 5 minutes

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