Dev.to
7/24/2026

Do Not Invent a 5-Hour Window in a Codex Usage Tracker
Short summary
A practical guide on building a Codex usage tracker that respects the current weekly quota window instead of inventing a deprecated 5-hour one. Covers provider-independent error states, local token-ledger deduplication, event-timestamp-based attribution, and pricing unknown models as unpriced rather than guessing. Verified on macOS v1.7.1 as part of the Agent Island dashboard.
- •Codex now exposes only a weekly window; UI must not hardcode the old 5h label
- •Each provider needs independent error, freshness, and refresh state
- •Local ledger should deduplicate replayed events and leave unknown models unpriced
Generated with AI, which can make mistakes.
Is this a good recommendation for you?



