API endpoint for token usage

I am already using tiktoken to count tokens before processing and using the token counts in the response while processing. No issue with that. But this has to be tracked while processing.

What I wanted was to be able to have an api endpoint to check usage after the fact. Just as the screenshot of the page I posted shows details after the fact.