Error: 429 Too Many Requests

I am trying to make a request to the openai API with the following code in express nodeJS:

import { Configuration, OpenAIApi } from "openai";

const configuration = new Configuration({
    organization: "org-Fn2EqsTpiUCTKb8m61wr6H8m",
    apiKey: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
});
const openai = new OpenAIApi(configuration);

async function callApi() {
    const response = await openai.createCompletion({
        model: "text-davinci-003",
        prompt: "Say this is a test",
        max_tokens: 3000,
        temperature: 0,
      });

    console.log(response.data.choices[0].text);
}

callApi();

The problem is that I keep getting error 429 Too many requests.

Here some more information:

  • The API key is correct.
  • When I go to my openai account > view API KEY: it shows that the key was never used so I have never been able to make a call. So how is it possibile that Iā€™m getting error Too many requests?
  • I have already tried to implement exponential backoff in the function, but it didnā€™t work.
5 Likes

Have similiar issue. I switched to a different model, text-davinci-002 then it works, maybe the third model is overloaded? However, I donā€™t know, this might only be a specific problem for me.

3 Likes

Literally same problem right now too. Server might be overloaded, yes.

2 Likes

Not working for me on any engine model atm.

2 Likes

Same problem here, Iā€™m using AWS Lambda with a NodeJS Express Server

1 Like

are there bit differencies with the text-davinci-002 ?

Having the same issue, donā€™t know why. Could it be because we are using free version ?

EDIT: I tried with a new account and it worked. I wonder if the dall-e uses the ā€œfreeā€ credits we have to use on the api

It is working on localhost but not on my AWS Lambda. Donā€™t know whyā€¦

1 Like

Hope you will be fine. That error code is due to excess of your daily(QPM - Query Per minute) limit

here is the rate limit for open ai

You need to build some timeout logic to meet rate limits and overcome that problem.

If any queries still please ask. Thanks

1 Like

I get the error anyway, and i Have never used it before. My api key still says ā€œUsed Neverā€ which is true;

1 Like

I am also getting the same issue. I have created a new account for trial. Do I need to add credit card to use free trial?

Also suggest Nuget library to use OpenAI using ASP.Net Core 6.

1 Like

Same here, getting a 429 even if I just do 1 api call per day

Same thing for me, I am a paying user and when I make 3 requests in one minute, I get error 429.
I am building a tool that will be used by many users, I need a solution to this problemā€¦

Same problem here @Starlink, crazy that nobody from open ai team can reply to us, even if we are paying for their service !

Same thing happened to me yesterday and when I checked my ā€˜Usageā€™ tab realized that my free trial had ended.

image

Generally youā€™ll have 3 months for free. I am guessing thatā€™s the reason.

Same problem here.
Tried several different models, and still get the same error.

Same problem, I tried like 5 minutes per request, donā€™t know the reason why.

Same here. Fully paid account. 429s even when making 30 requests per hour. At a total loss with no comms from OpenAIā€¦

1 Like

Iā€™m a paid account. I meet this tooā€¦help. I make no more than 100 requests a day also not reach the limitā€¦

This is so strange.

I make a lot of daily API calls, and have never had this problem except when I pulled 100s of text strings out of a DB and sent them to the embeddings API without a delay in the loop! That broken things fast, after a few iterations.

However, for all ā€œnormalā€ (not in a fast loop) API call, I have never had this issue, ever.

My best guess is that there is some ā€œstrangenessā€ going on with Cloudflare, based on some access / rate limiting criteria we are not aware of. It is also possible that OpenAI has been so busy that the have not updated their "work flow " to update Cloudflare rate limiting on a ā€œper userā€ basis. However, I ā€œthinkā€ (from all the posts here) the issue resides in Cloudflare.

You can see from this Cloudflare doc, that every user would have to match a criteria and the Cloudflare rate limiting rule updated / created:

Iā€™m not a Cloudflare person (or a big fan of Cloudflare, TBH), but it does not seem ā€œtrivialā€ to set up Cloudflare on a ā€œper userā€ basis based on a OpenAI plan which is outside of the Cloudflare ecosystem.

It could easily be possible that the OpenAI staff is not aware of what must happen on the Clouldflare end of things to support their new paid plans?

1 Like