UWCS / apollo

A Discord bot for the University of Warwick Computing Society
MIT License
11 stars 17 forks source link

OpenAI usage tracker #236

Open Mole1424 opened 9 months ago

Mole1424 commented 9 months ago

Usage tracker broken image site 403s could fix or not include given openAI keys have changed so dont know what price is, maybe ask Joey?

Mole1424 commented 9 months ago

So had a look into this:

currently everything is undocumented and their is no official way (although apparently one is coming). The only working way I found is to run a get request to https://api.openai.com/v1/usage?date=YYYY-MM-DD every day. This will then return token usage which you can map to the public pricing at https://openai.com/pricing and then calculate cost in $ then convert to £.

This is very jank so ive decided to temp remove this feature until there is a more official method.

PS the original method that joey used now needs a browser session id as auth which caused the implementation to break.