提示词库/任务指令/OpenAI Completions Usage API Extended Example
OpenAI Completions Usage API Extended Example
exp-0498未验证
# OpenAI Completions Usage API Extended Example
For most of our users, the [default usage and cost dashboards](https://platform.openai.com/usage) are sufficient. However, if you need more detailed data or a custom dashboard, you can use the Completions Usage API.
This notebook demonstrates how to retrieve and visualize usage data from the OpenAI Completions Usage API and Costs API. We'll:
- Call the API to get completions usage data.
- Parse the JSON response into a pandas DataFrame.
- Visualize token usage over time using matplotlib.
- Use grouping by model to analyze token usage across different models.
- Display model distribution with a pie chart.
We also include placeholders for all possible API parameters for a comprehensive overview.