Duplicate usage events overbilled an AI SaaS bill by $115

A naive usage counter overbilled $3,266.75 of AI usage by $114.86, a 3.5 percent error across all 500 tenants, because the queue delivered 6,984 of 200,000 events twice (our lab, 2026).

A ledger keyed by event ID matched the true total exactly and ingested 104,000 events per second on SQLite, while rounding each event up to the cent overbilled by 28.9 percent.

Send Stripe closed hourly totals with stable identifiers, which cut 200,000 events to 12,000 calls, and reconcile the ledger against what you send every night.

Read the full post

Read the full post