Are you a free trial user?
if you are, have a read of the last couple of posts here
(Especially the usage table)
You may be going over the 20 requests a minute. Putting in a credit card may help (Even if you have credit left)
1 Like
Hi Raymond,
Thank you for your reply.
I am not a free user, I have a monthly rate of $300.
And I saw the program costs me some money and stops in the middle, it is actually quite upset since some money was wasted even though it was not a lot.
I also thought there might be some requests quota issue, so I tried to add a time.sleep(1) to stop 1 sec after each call, but not useful for me.
3 Likes
My initial approach would be trying to save after each call and resume running where it stops,
but it seems really painful to do it in such way that I have to monitor all the way especially when I want to make thousands of calls in one sequence.
So I am wondering how others deal with it.
Thank you so much!
I also started facing same issue.
Note: I am using async implementation, v 0.26.0 openai python libray that got released 4 days back.
@raymonddavey
samw
6
I’m running into the same issue with davinci-003 on a paid account making no more than 50 calls/min. I reported a bug for a similar issue where I hit a rate limit, will respond here if I hear back
sernyl
7
I can’t get more than 5 calls/min, and I’m a paid user. Not sure what’s going on?
1 Like
Hi, did you hear any response?
samw
9
Not yet, but I stopped receiving the error after a few hours.
Lots of outages in the past week, check out or subscribe to for the latest:
1 Like
Not sure why but I just tried and still have a lot these issues either showing:
openai.error.ServiceUnavailableError: The server is overloaded or not ready yet.
or
openai.error.RateLimitError: The server is currently overloaded with other requests. Sorry about that! You can retry your request, or contact us through our help center at help.openai.com if the error persists.
Any update on this? I can confirm issues with davinci-003 are still happenng.
This is happening to me too, are there any updates? At least give us some timeout rules to implement and ensure that the requests keep operative.
sidd
14
This is happening for last 1-2 weeks for us, despite being paid users (spending >$500 every month). This is impacting our first few set of clients, affecting our output quality and quite frustrating.
Would anyone know if there are any limits / min set by OpenAI? or some premium plans where this doesn’t happen. Wonder how bigger players (copywriting tools) are managing unless they have a dedicated server or using via Azure (which too is limited access).
Thanks
chris10
15
I have the same problem and it keeps occuring. At first it only appeared to happen when going over a 100 queries, but now I can’t get even 50 queries done before it errors out. It’s a bit frustrating because I can see my usage increasing but getting nothing for it in return. I’m running queries to export to CSV in a for loop. I’m on a paid account. Swift resolve would be greatly appreciated.
Hi Chris,
Not sure if this solves your problem, but to me when I do a sequence of calls, it stops in the middle with nothing saved and money deducted. Looks like the service now is not very stable and there is no fix.
So I try to catch this error and recall by doing something like this:
for i in range (100):
flag = True
while(flag):
try:
response = openai.Completion.create(
model="text-davinci-003",
)
flag = False
except openai.error.OpenAIError as e:
print("Some error happened here.")
evanl
17
Running into similar problem today.
# originally
openai.error.RateLimitError: The server is currently overloaded with other requests. Sor
ry about that! You can retry your request, or contact us through our help center at help
.openai.com if the error persists.
# latest
openai.error.ServiceUnavailableError: The server is overloaded or not ready yet.
Same script worked fine for loop performing 500+ requests (not async) several times yesterday.
There is plenty of credits left in the account.
evanl
19
I ended up adding a simple exponential back off. After 1–2 seconds of delay, the repeated requests that errored usually succeeds on the second try.
for delay_secs in (2**x for x in range(0, 6)):
try:
# Call openai request such as text completion
break
except openai.OpenAIError as e:
randomness_collision_avoidance = random.randint(0, 1000) / 1000.0
sleep_dur = delay_secs + randomness_collision_avoidance
print(f"Error: {e}. Retrying in {round(sleep_dur, 2)} seconds.")
time.sleep(sleep_dur)
continue
1 Like
Yes, exponential backoff seems to be the solution. I took advantage of Tenacity, as explained in Rate Limits - Error Mitigation.
I used the retry parameter and passed to retry_if_exception_type() the exceptions I wanted to be considered for exponential backoff.
from tenacity import (
retry,
stop_after_attempt,
wait_random_exponential,
retry_if_exception_type
) # for exponential backoff
@retry(
retry=retry_if_exception_type((openai.error.APIError, openai.error.APIConnectionError, openai.error.RateLimitError, openai.error.ServiceUnavailableError, openai.error.Timeout)),
wait=wait_random_exponential(multiplier=1, max=60),
stop=stop_after_attempt(10)
)
def chat_completion_with_backoff(**kwargs):
return openai.ChatCompletion.create(**kwargs)
# [...]
response = chat_completion_with_backoff(
model=model,
messages=[
{"role": "system", "content": system_msg},
{"role": "user", "content": longtext},
],
max_tokens=max_tokens,
)
4 Likes
Thanks a ton! This really helped us out when we received this error using “gpt-3.5-turbo-16k”
e.covas
22
Hi,
with the new openai API 1.2, this does not seem to work, I tried
@retry(wait=wait_random_exponential(min=1, max=120), stop=(stop_after_delay(60) | stop_after_attempt(6)),
retry=retry_if_exception_type((APIError,APIConnectionError,RateLimitError,APIStatusError,Timeout)))
def chat_completion_with_backoff(azure_openai_client = None, **kwargs):
return azure_openai_client.chat.completions.create(**kwargs)
I think the problem are the types of open ai errors which I imported with
from openai import AzureOpenAI # see new API format in https://github.com/openai/openai-python/issues/740
from openai import APIError
from openai import APIConnectionError
from openai import RateLimitError
from openai import APIStatusError
from openai import Timeout
It does not seem to retry at all… Any ideas?
Thanks
Eurico