Best way to track wasted spend on OpenAI API calls

· 3 min read

To track wasted spend on OpenAI API calls, use two layers. Start with the OpenAI Usage Dashboard to see what you spent by project, key and model. Then record each call in your own app, so you can see which calls were repeats, loops or cache misses that bought nothing.

What the OpenAI dashboard tells you

The Usage Dashboard is the source of truth for the bill. Viewing it needs an organization owner or the Usage Dashboard permission.

Two things catch teams out. Data is shown in UTC, and recent usage may take time to appear. Playground tokens also count toward API usage. For Enterprise customers, invoices from April 1, 2026 no longer include detailed API costs, so the dashboard and exports matter more.

Where the dashboard stops

The dashboard counts tokens. It does not know why a call was made. If several apps share a project or key, the total alone may not show which one sent a request. It also cannot tell a useful call from a wasted one, such as:

  • a request your code re-sent after a timeout
  • an agent repeating the same tool call in a loop
  • a streamed answer the user closed before it finished
  • an answer cut off at the token limit and asked for again

To see those, record a small entry for each call in your app: model, tokens, timing, the run it belonged to, and a hash of the request so repeats can be matched without storing prompt text. Group the entries by run and look for the same request sent twice or more. When you compare these logs with the dashboard, use UTC.

Zexl does this for Python apps with one import: it records tokens, timing and hashed fingerprints, never prompt text, and prices each wasted pattern. It is free during early access.

FAQ

Can the OpenAI dashboard show duplicate calls?

No. It shows totals by project, key, model and time. Spotting a duplicate needs a record of each call with a fingerprint of the request, kept on your side.

Does OpenAI send spend alerts?

Check your organization's billing settings for limits and notices. For alerts on waste, such as a loop in one agent, you need call level data from your own app.

Why do my logs not match the dashboard?

The dashboard is in UTC and recent usage can lag. Playground use also counts. Compare whole UTC days, and give each app its own project or key.

How do I see if prompt caching works on OpenAI?

Compare cached input tokens with total input tokens for the model in the Usage Dashboard. If a prompt you send many times a day shows almost no cached tokens, the start of the prompt is changing between calls.

See where your own AI spend goes

One import in a Python app, or five environment variables for Claude Code. Prompts never leave your servers.