others-how to fix error code 1020 when trying to access chatGPT or chat.openai.com?

1. Purpose

In this post, I will show you how to solve the following errors when tryging to access ChatGPT or chat.openai.com:

Access denied
Error code 1020
You do not have access to chat.openai.com.

The site owner may have set restrictions that prevent you from accessing the site.

The error details:

I got an error when visiting chat.openai.com/.

Error code: 1020
Ray ID: 19939124ab335ab
Country: US
Data center: sea07
IP: 24.221.2.116
Timestamp: 2023-01-12 05:44:04 UTC



2. Solution

According to stackoverflow’s user Ked Mardemootoo , the reason is:

This happens because the site has Rate Limiting enabled. Depending on the logic they have in place, your IP address would be blocked from anywhere between 15mins to 1hour. It’s not something to do with your code - it’s just a security mechanism specifically put in place to prevent this kind of action.

You could probably try one request per hour or keep changing your IP address for each request.

And here is the recommendation ideas from cloudflare, who is the security provider for ChatGPT:

Quick Fix Ideas

If you are visiting the site, contact the site owner and let them know that you received the Access denied error and ask them to check their Firewall Rules. Only the owner of the site you’re visiting can tell you why you are unable to access the site. Contacting Support or posting here will not result in an answer.

If you are the site owner and you want to isolate what rule is being violated, first review your Firewall Rules. Next, turn off the firewall rules to see if the challenge goes away. Turn them all off, check, and if the error goes away, begin to turn them on one at a time. After you assess the cause of the block, either update the Firewall Rule or allow the visitor’s IP address in IP Access Rules 373.

Alternatively, search for the RAYID in the Firewall Events Log to determine which rule is being violated.

You can verify the issue is caused by your Firewall if you disable Cloudflare and then visit the site. See How do I disable Cloudflare 17.1k?

If you only want to protect a portion of your site or isolate what rule is being violated, turn off WAF for the entire domain and use Page Rules to enable WAF for specific URLs.

If you encounter the error 1020, you’re violating a firewall rule the site owner has put in place, the error has nothing to do with Cloudflare Access.

So the best solution for this problem is to change your internet IP address immediately, if you are using a VPN service, you should contact your vpn provider to get a new IP address.



3. Summary

In this post, I demonstrated how to fix ChatGPT’s error 1020 problem. That’s it, thanks for your reading.