代码如下:
import requests
url = 'https://api.openai/dashboard/billing/credit_grants'
api_key = "#填写你的key#"
headers = {
"Authorization": "Bearer " + api_key,
"Content-Type": "application/json"
}
response = requests.get(url, headers=headers)
print(response.text)
查询结果:
解释如下:
total_granted: 授予总数
total_used: 已用总量
total_available: 总可用量
记得代理,正常拿应该是拿不到的。
觉得有用的点个赞
更多推荐
chatGPT查询api的余额
发布评论