How can i check OpenAI usage with Python?

r = openai.api_requestor.APIRequestor();
resp = r.request("GET", '/usage?date=2023-04-05'); // or start_date and end_date
resp_object = resp[0]
resp_object.data // this object has all the info
2 Likes