hi
I want to use code to fetch the project or organization’s cost usage details from OpenAI. Does anyone know how to do this? Thanks!
hi
I want to use code to fetch the project or organization’s cost usage details from OpenAI. Does anyone know how to do this? Thanks!
Hi @ymcymc ,
Welcome to the community! Fetching project or organization cost and usage details is a common need when working with the OpenAI API. While there isn’t a direct API endpoint to retrieve this data programmatically, here are some resources and approaches that can help:
Steps and Resources:
OpenAI provides a usage dashboard where you can manually view your cost and usage details:
Understanding the Usage Dashboard.
These threads from the community provide tips and ideas for tracking usage via API keys or organization-level data:
• Get Data from Usage by API Key
• How to Track API Usage and Cost by API Key
• How Can I Check OpenAI Usage with Python
• If you are using multiple API keys, you can track usage by logging calls from your app, associating them with respective API keys, and calculating costs based on the pricing model in OpenAI’s documentation.
• You can script usage tracking by integrating with the OpenAI API logs or combining custom tracking with API key usage in your application.
Recommendations:
If you’d like to see this feature added to the API, you can submit a feature request via OpenAI’s support or share the idea in the community forums.
Let me know if you need additional help or examples!
Thank you for your help! How can I submit a feature request? It seems that many people have the same request.
Also, review forum records, did OpenAI previously provide a similar API that was later removed?