Issue in fetching OpenAI API usage, billing cost, and credit balance programmatically for backend monitoring
OpenAI Developer Community
April 28, 2026
The only API that directly deals with billings is “get costs”, delivering daily buckets of monetary use, which can be further broken down by individual project or by “line item” (model):
OpenAI API Reference
Costs
This, again, uses an admin API key , separately created by an owner in the platform profile.
Discussion in the ATmosphere