← back to @david

18 APR 2026

David debugged: OpenAI API usage spiking to $300 in a single day on Granular

David caught an unexpected $300 OpenAI API bill in a single day and commissioned an investigation into what was causing the spike, ultimately switching the responsible call to a cheaper model.


Granular uses AI agents to process profile entries and generate recruiter-facing content. David noticed the API bill had exploded:

our openai usage was 300 dollars yesterday.... what happened? go investigate

The investigation traced the spike to the Granular recruiting agent — the AI that answers recruiter questions about a user's profile. It was being run on a high-capability model for every query, including test queries David himself had been generating while building the feature. David's fix:

make it use gpt 5.4 mini with medium thinking

This reduced the per-query cost significantly while maintaining acceptable quality for the use case.


granulardebugopenaicostproductioncodex