Dev builds tiny logger to find what eats OpenAI budget — token counts pointed to the wrong feature
Atm1n9 · reddit · 2026-10-11
The author wanted to know which feature in their app was burning their OpenAI budget, so they built a small logger: after each call, log the usage object's token counts with a feature tag and price them manually.
Pricing yourself is trickier than expected: cached reads bill differently from normal input, and cache writes can cost more; reasoning tokens bill as output though invisible; providers disagree on whether cached tokens sit inside the prompt count (the author double-counted for a while); audio tokens can cost several times the text rate on the same model.
Others got hit harder: one Google AI dev forum user saw €290 in search charges attached to €10 of actual LLM usage, bypassing their spend cap; a DEV post described a timeout-plus-auto-retry on long-context calls quietly doubling costs while every dashboard stayed green; one startup reported a $113k single-month AI bill.
Counterintuitive result: the code-gen feature did eat 70% of the bill, but by token count the summarizer was far bigger (129M vs 30M) yet cost only $14 total — token counts alone would have blamed the wrong feature. The logger later grew into a product, LLMtrack.
Related event: Developer builds logging tool to trace OpenAI bill burning budget(2 posts)→
More from coding & agent
- Pick AI tools by finding your bottleneck, not by chasing the newest model — brandongalang · 2026-11-29
- Dev uses Codex to clone Obsidian's UX with high fidelity, passing 24/24 acceptance tests — burkov · 2026-11-29
- Dev vibecodes a PS1-style dark fantasy browser game over breakfast, open-sources it — XRarchitect · 2026-11-29
- Dev builds PS1-style dark fantasy demo over breakfast after replaying RuneScape — XRarchitect · 2026-11-29
- Dev: a month with iPhone Duo, 25-30% of my Rork work shipped with it — rudrank · 2026-11-29
- CHGIS MCP Server lets agents query Chinese historical geography from 222 BCE to 1911 CE — modelcontextprotocol · 2026-11-29