I’ve written an OpenAI integration for WordPress, for my client. They have a large number of users using it, and they’d like me to develop a way of showing who is using the most tokens, so they can come up with a pricing model for using this tool.
If I knew the token usage for a given API call, I’d stash it in the database and be in position to offer some nice usage on reporting.
However, 100% of my work uses the “streaming” option for the OpenAI API. Given that, I’m having trouble seeing how I can conveniently keep track of the token usage for a given request.
Am I missing something obvious here?