OpenAI API returns 429 despite backoff
Yesterday I was trying to run a batch job through the completions endpoint using text-davinci-003.
Got this back immediately:
{
  "error": {
    "message": "You exceeded your current quota, please check your plan and billing details.",
    "type": "insufficient_quota",
    "param": null,
    "code": "insufficient_quota"
  }
}
No Retry-After header. First request failed. Slowing down didn’t help.
Python 3.10 script using openai version 0.26.4. Running in GitHub Actions on ubuntu-latest. Key loaded from repo secrets.
Usage well below quota. Billing details looked fine. Same key worked the day before.
The key was linked to an old organisation.
Fixed it by:
- going to https://platform.openai.com/account/usage
 - clicking my name in the top right
 - switching to the correct organisation
 - generating a new key
 - updating the key in GitHub secrets
 
That resolved it.
429 was the wrong status. This was not a quota issue.
