ChatGPT icon indicating copy to clipboard operation
ChatGPT copied to clipboard

[BUG] {"detail":"Too many requests in 1 hour. Try again later."}

Open acheong08 opened this issue 2 years ago • 19 comments

This is because your IP address has been blacklisted by OpenAI. To solve this, use a VPN (proxy not recommended).

Email me if you need a free Wireguard VPN. (From a third party. The extra step is to prevent overloading their services. It may not stay free.)

acheong08 avatar Dec 26 '22 17:12 acheong08

For me, I initialize the Chatbot, and the first prompt gets a response as expected, but the second one fails with that error:

chatbot = Chatbot(config)
chatbot.get_chat_response("This is prompt 1", output="text")
chatbot.get_chat_response("This is prompt 2", output="text") # this one fails

I tried doing time.sleep() up to 25secs between each request, and it doesn't help.

error logs (the "429 too many requests returns "Too many requests in 1 hour. Try again later.")


response <Response [200 OK]>
response <Response [429 Too Many Requests]>
Traceback (most recent call last):
  File "/Users/frcassarino/Library/Python/3.8/lib/python/site-packages/revChatGPT/revChatGPT.py", line 202, in __get_chat_text
    response = response.text.splitlines()[-4]
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/frcassarino/Library/Python/3.8/lib/python/site-packages/revChatGPT/revChatGPT.py", line 209, in __get_chat_text
    if resp['detail']['code'] == "invalid_api_key" or resp['detail']['code'] == "token_expired":
TypeError: string indices must be integers

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "test_webhook.py", line 520, in <module>
    request_handler.handle_webhook(mock_body)
  File "/Users/frcassarino/Documents/GitHub/ChatGPT-PR-Reviewer/request_handler.py", line 41, in handle_webhook
    review = mock_review if should_mock else self.generate_review(changed_files)
  File "/Users/frcassarino/Documents/GitHub/ChatGPT-PR-Reviewer/request_handler.py", line 94, in generate_review
    print(chatbot.get_chat_response(file, output="text"))
  File "/Users/frcassarino/Library/Python/3.8/lib/python/site-packages/revChatGPT/revChatGPT.py", line 553, in get_chat_response
    return asyncio.run(coroutine_object)
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/Users/frcassarino/Library/Python/3.8/lib/python/site-packages/revChatGPT/revChatGPT.py", line 259, in get_chat_response
    return await self.__get_chat_text(data)
  File "/Users/frcassarino/Library/Python/3.8/lib/python/site-packages/revChatGPT/revChatGPT.py", line 213, in __get_chat_text
    raise Exception("Not a JSON response") from exc2
Exception: Not a JSON response

FRCassarino avatar Dec 26 '22 21:12 FRCassarino

Yes. It means your IP address has been blacklisted. You can check out some working VPNs at https://vpn.fail

acheong08 avatar Dec 27 '22 03:12 acheong08

It seems you are still using the old version of the repository. Please upgrade with pip3 install --upgrade revChatGPT

acheong08 avatar Dec 27 '22 03:12 acheong08

It seems you are still using the old version of the repository. Please upgrade with pip3 install --upgrade revChatGPT

Ah I had tried to upgrade but I guess something hadn't worked. Switched to the new ask() method and it works fine now.

FRCassarino avatar Dec 27 '22 18:12 FRCassarino

this could also be because of an expired session token

DiamondDemon669 avatar Dec 28 '22 06:12 DiamondDemon669

This is normal, I think. I was using the GUI of ChatGPT for a purpose when I overloaded it with many requests of very similar type. After say 40 or 50 of them, it just told me to wait 1 hour.

pepi99 avatar Dec 28 '22 09:12 pepi99

Yup. They're trying to limit costs. You can work around it by cycling multiple accounts with the API

acheong08 avatar Dec 28 '22 10:12 acheong08

try use https://chatgpt.sbaliyun.com/

sbaliyun avatar Dec 29 '22 11:12 sbaliyun

@sbaliyun It's very slow compared to the OpenAI API.

You also have a CORS error

acheong08 avatar Dec 29 '22 11:12 acheong08

And it's not even ChatGPT. That is just GPT-3. The API call:

frequency_penalty:0
max_tokens:2048
model:"text-davinci-003"
presence_penalty: 0
prompt:"ahQacK4WSFcwt/BAQf9b+5gZBRJZe1Vvau8OSZpNpjBBHqBwXFoSLxGX+ywsuXRLBslxlc0DUrwuGo2c1zaNCsJkIzvNAcqCX+1xYN7YTc43/CisyJOjkj9XpJpN87KYlnOzMg3fgecEIVtOVQKoYnSP0fMIgU99Z2Qr4dNKyB4="
temperature:0.5
top_p:1

acheong08 avatar Dec 29 '22 11:12 acheong08

Check out acheong08/ChatGPT-lite. It solves all the annoying browser problems at the cost of your privacy

acheong08 avatar Jan 01 '23 18:01 acheong08

@acheong08 Have you added any built-in delay between requests to avoid people getting rate limited? If not do you have any idea how much time we should wait between request? Also does ChatGPT-lite solve the issue of getting rate limited?

steeljardas avatar Jan 01 '23 23:01 steeljardas

Does anyone have statistics on what this rate limit is approximately ?

AprilNEA avatar Jan 02 '23 05:01 AprilNEA

@acheong08 Have you added any built-in delay between requests to avoid people getting rate limited? If not do you have any idea how much time we should wait between request? Also does ChatGPT-lite solve the issue of getting rate limited?

It solves IP based rate limiting but not account rate limits. There are no built in rate limit preventions yet

acheong08 avatar Jan 02 '23 06:01 acheong08

Does anyone have statistics on what this rate limit is approximately ?

I'm getting rate limited after ~50 requests

acheong08 avatar Jan 02 '23 06:01 acheong08

This is a CLI issue and not an app issue, but pasting in to cmd with line breaks causes it to enter each new sentence after the other, creating a bunch of requests unnecessarily. I don't know if !rollback helps with this?

Anyway, tried using NordVPN and refreshing session, but I still get "Too many requests". If I where to switch to a new session-token wouldn't that create a new conversation, forcing you to begin from scratch with your prompts?

Andy7737 avatar Jan 07 '23 06:01 Andy7737

Anyway, tried using NordVPN and refreshing session, but I still get "Too many requests".

Most large VPN providers are getting rate limited

This is a CLI issue and not an app issue, but pasting in to cmd with line breaks causes it to enter each new sentence after the other, creating a bunch of requests unnecessarily. I don't know if

Paste it somewhere that removes new lines such as browser's search bar then copy paste again

If I where to switch to a new session-token wouldn't that create a new conversation, forcing you to begin from scratch with your prompts?

yes if token from different account

acheong08 avatar Jan 10 '23 14:01 acheong08

Can someone please tell me how long the rate-limit lasts? an hour?

TIA :smile:

wise-introvert avatar Jan 28 '23 08:01 wise-introvert

it this message show than change your account or make another account with other email then you have two chat gpt if one stop then another

Piyush-kumarr avatar Feb 09 '23 07:02 Piyush-kumarr

it this message show than change your account or make another account with other email then you have two chat gpt if one stop then another

does this method work?How many requests to run in ten seconds?

dbbice avatar Mar 13 '23 05:03 dbbice

Can someone please tell me how long the rate-limit lasts? an hour?

TIA 😄

Have you solved it now?How many requests to run in ten seconds?

dbbice avatar Mar 13 '23 05:03 dbbice

Can someone please tell me how long the rate-limit lasts? an hour?

TIA 😄

Have you solved it now?How many requests to run in ten seconds?

dbbice avatar Mar 13 '23 05:03 dbbice

5 requests per 10 seconds for the proxy. There is different rate limit from OpenAI based on accounts but you can cycle them.

acheong08 avatar Mar 13 '23 05:03 acheong08