Simple OpenAI Tool for generating token usage reports

OpenAI’s developer page is notoriously spartan in its design and lacks many useful features. One of the most annoying thing for me personally is trying to get token usage reports for analysis or other use.

So I built a simple OpenAI Tools Streamlit app. Just paste in your OpenAI key* and organization ID, select a user and start/end date ranges and click generate.

For longer time spans you have to wait a bit, because currently OpenAI’s usage API has a 5 requests per MINUTE(!) throttling limit, and you cannot query a date range, so EACH DAY counts as one API call… but at least it beats you manually selecting the daily drop-down menu on their website and clicking around (while also slowing down to the 5 RPM rate…)

So, just start the process and go get a coffee or something…

*) Yeah I thought you were gonna ask about me stealing your API keys… so here’s a link to the GitHub repo of the project so you can review the code, and anyways, you should always use disposable, app-specific API keys that you can disable anytime without affecting your other apps.


Great one, @tipani86! :raised_hands:

So handy that I had to share it internally! :fire:

I’ll definitely use it myself too! :blush:



I wish I could change the title of the thread now, because I’ve updated the app to include a full-fledged support for managing training datasets, finetuning jobs, metrics evaluation and model testing following this week’s OpenAI announcement for ChatGPT finetuning.

Full feature list on the project’s GitHub page.

(Yes, the tokens counting automation is still there, just added a lot more to this OpenAI Tools mini app. Go try it now!)

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.