🔧 Engineering

Engineering

The engineering side of billing — metering pipelines, idempotency, ledger design, and infrastructure.

🎯 Key Takeaways

Your Billing System Can't Count Small Enough

AI billing broke the billing stack. You're charging per token, per inference, per GPU millisecond — and your billing system is rounding most of it to zero. Here's the fix.

AI billing generates transactions so small your billing system rounds them to zero.
Read the take →

Frequently Asked Questions

What is idempotency in billing systems?

Idempotency ensures that processing the same event multiple times produces the same result. In billing, this prevents double-charging when events are retried. Implement it with unique event IDs and deduplication at the ingestion layer — every metering event needs an idempotency key.

How do you handle nanotransactions in billing?

AI inference generates transactions so small (fractions of a cent) that traditional billing systems round them to zero. Solutions: aggregate into hourly/daily buckets before rating, use high-precision decimal types (not floats), and design your ledger for sub-cent granularity.

What are the key components of a metering pipeline?

Event ingestion (API or streaming), deduplication (idempotency keys), buffering (handle burst traffic), aggregation (time-window rollups), rating (apply pricing rules), and storage (append-only ledger). Each component needs monitoring — silent metering failures are the most expensive bugs in billing.