External Publication
Visit Post

Issue in fetching OpenAI API usage, billing cost, and credit balance programmatically for backend monitoring

OpenAI Developer Community April 28, 2026
Source
You have given dashboard API endpoints, which are only for use by the platform site and a browser, with session key and bot validation checks. They are not for programmatic use. You will need to use an organization admin API key in order to call administration API endpoints. Then consult the API reference for the calling methods and what resources are available. You should code so that you get an error status code and body error message. This would reveal any faults in your calling technique, such as “not authorized!”

Discussion in the ATmosphere

Loading comments...