Comment

Comment by Koshima

Appreciate it. For token-based metering, we lean on event-level tracking with strict timestamps and unique identifiers to maintain billing precision, even when upstream responses are delayed or partial. If OpenAI or similar services provide incomplete data, we flag those events for retry or exclusion to avoid corrupting aggregates.

Retroactive adjustments are handled by versioning usage records, so instead of overwriting historical events, we apply corrections as delta events. Invoices pull from the latest state, but we preserve full audit logs underneath to avoid integrity gaps.

parent Koshima 1 year ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton