OpenAI修改了查询Token余额的方式插图

错误表现

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
  }
}
OpenAI修改了查询Token余额的方式插图1
Jonathan KemperUnsplash 拍摄的照片

深入调查

目前请求的接口未变:https://api.openai.com/dashboard/billing/credit_grantsheaderauthorization:Bearer sess-NY9FavD0q4VpFRfN3HF*****************

OpenAI修改了查询Token余额的方式插图2

可能只有通过测试对话的方式来查询秘钥是否有效了,不过依然可以进行账单查询。后续想要查询token的余额,可能需要跳转Open AI登录获取