错误表现
2023-04-01 15:53:47,158 [ERROR] [openai_func.py:81] 获取API使用情况失败:API request failed with status code 403: {
"error": {
"message": "Your request to GET /dashboard/billing/credit_grants must be made with a session key (that is, it can only be made from the browser). You made it with the following key type: secret.",
"type": "server_error",
"param": null,
"code": null
}
}
深入调查
目前请求的接口未变:https://api.openai.com/dashboard/billing/credit_grants
,header
的authorization
:Bearer sess-NY9FavD0q4VpFRfN3HF*****************
可能只有通过测试对话的方式来查询秘钥是否有效了,不过依然可以进行账单查询。后续想要查询token的余额,可能需要跳转Open AI登录获取