There are two main options for checking your token usage:
The usage dashboard displays your API usage during the current and past monthly billing cycles. To display the usage of a particular user of your organizational account, you can use the dropdown next to "Daily usage breakdown".
2. Usage data from the API response
You can also access token usage data through the API. Token usage information is included in responses from our endpoints under the usage key.
Here's an example:
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1677858242,
"model": "gpt-3.5-turbo",
"usage": {
"prompt_tokens": 13,
"completion_tokens": 7,
"total_tokens": 20
},
"choices": [
{
"message": {
"role": "assistant",
"content": "This is a test!"
}
}
]
}
If you're using streaming for our completions and would like to access usage data, ensure that your stream_options parameter contains the following:
stream_options: {"include_usage": true}
. Here's our cookbook for How to stream completions and our platform documentation on streaming.