Everyone watches their OpenAI bill. Almost nobody knows which feature is burning it.

by

I spent a year shipping AI features and the hardest part was never the AI. It was the bill.

I started with one provider, then added a second for longer context, a third for the cheap calls. Pretty quickly I had four keys, four SDKs, and four billing pages that never agreed. At the end of the month I could see one number, the total, and almost nothing about where it actually went. Which feature, which customer, which model.

A few things I learned the hard way:

  • The total bill is the least useful number you have. Attribution per feature and per model is what tells you where to cut.

  • A lot of traffic repeats more than you think. Support questions, retries, docs lookups. Caching the answer to those saved me more than swapping to a cheaper model ever did.

  • But naive caching is dangerous. Matching on wording alone serves confident wrong answers. You need something that checks the meaning actually matches, and a freshness rule so it never serves stale data.

  • Cheaper model does not mean cheaper request. Some cheap models are wordy and burn more tokens per answer than a pricier one that gets to the point.

I ended up building this into one endpoint that sits in front of every provider, so I get one log, one cost view, and caching I can actually trust. It is called CoreCtic.

Curious how the rest of you handle it. Do you track AI cost per feature or per customer today, or is it still a monthly total and a bit of hope?

3 views

Add a comment

Replies

Be the first to comment