Hello.
It is very needed to get a support to make an API call and get status of the balance.
Currently, due to unpredictable usage - I don’t want to setup auto top-up and also don’t want to loose access to API at any point.
Why there are no possibility to check the balance using API call?
Please add it.
I would say that OpenAI doesn’t have that information in realtime.
they most probably do it periodically like every 15 minutes or twice a day to save compute power.
But you can keep track on it by saving the usage in a database and just do a
SELECT sum(t1.instruction_token) * t2.instruction_token_price / 1000000 + sum(t1.completion) * t2.completion_token_price / 1000000
FROM usage t1 INNER JOIN models t2 ON t1.model_Id = t2.id
WHERE … add some constraints e.g. for the timeframe you are looking for