crews

crews

保持学习和对新事物的热情~ Magic

Build your own ChatGPT web version in 30 minutes.

Background

Recently, I tried using chatGPT for interaction, but due to OpenAI's enhanced anti-cheating measures, the page would frequently refresh, resulting in a very poor overall user experience. Therefore, I started looking for ways to build my own web version of chatGPT to make the interaction smoother. Even those without programming experience can give it a try!

Prerequisites

  • OpenAI API key
  • Vercel account (free registration)
  • GitHub account (free registration)
  • Cloudflare (free registration)
  • Domain name (optional)

Once you have all of the above prepared, you can start building your own web version of chatGPT in 10 minutes.

10-Minute Guide to Building Your Own Static GPT Page

Step 1: Find the Repository

Open the repository "https://github.com/Yidadaa/ChatGPT-Next-Web" and find the README instructions.

Click on "Deploy" as shown in the image above, and you will be taken to the Vercel interface to proceed.

Step 2: Configure Vercel

On this page, select GitHub and click "Create" to create a code repository under your account and associate it with Vercel.

How to obtain the OPENAI API KEY: Go to "https://platform.openai.com/account/api-keys" and find the "Create new secret key" button. A popup will appear with a string starting with "SK", which is the OPENAI API KEY.

"OPENAI_API_KEY" is the OpenAI API key.

"CODE" is the password that needs to be set in the web page for access control. If not set, anyone can use it, which may lead to malicious use if the page is discovered online. It is recommended to set a longer password.

Click "Deploy" and the program will start running. Just wait for it to finish.

By now, the deployment is successful. Find the corresponding URL and you can access the independent online web version of chatGPT by clicking "Continue to Dashboard" to go to the control panel and clicking on the address in the red box.

Setting Up a Custom Domain Name

After completing the above steps, you can already access your own ChatGPT web page independently. However, the domain name provided by Vercel is too long. If you have specific requirements for the domain name, you can try purchasing one yourself. The detailed process of buying a domain name will not be covered here.

Here, we will explain how to configure domain name forwarding.

Vercel Console

  • In the Vercel console, go to "Settings" → "Domains" → "Add" and enter the domain name.

After adding it, if you see the prompt "Invalid Configuration" as shown in the image below, it means that in order for this domain name resolution to take effect, you need to configure the corresponding CNAME resolution in your domain name provider's management backend.

Vercel.app has been blocked due to heavy usage, but fortunately, Vercel provides separate IP and CNAME addresses for everyone. For users in China, you can still enjoy the services provided by Vercel by configuring separate resolution. Replace the IP and CNAME addresses used in the above steps with the following:

A Record Address: "76.223.126.88" or "76.76.21.98", etc.

CNAME Record Address: "cname-china.vercel-dns.com"

Completion

If the domain name service is configured correctly, the Vercel card will look like the image above.

The above example shows the effect of a second-level domain name. If you want to forward the root domain name, additional steps are required.

Vercel Backend

After adding the root domain name, Vercel will prompt you to add an "@" record pointing to Vercel's server, which is "76.76.21.21".

Domain Name Management Backend

Simply resolve the root domain name to Vercel's server address: "76.76.21.21".

Further Reading: Difference Between A Record and CNAME

An A record resolves a domain name to an IP address.

A CNAME record resolves a domain name to another domain name.

They have similar functions. CNAME allows multiple hostnames to point to an alias, which is essentially the same as pointing to an IP address because the alias also needs an A record.

Final Note

If you are interested after reading this article, you can give it a try. It takes less than 30 minutes to set up your own chatGPT with a custom domain name. The speed is really fast.

However, the free account has a limitation of only 3 API requests per minute, which is sufficient for normal use but may be inconvenient for multiple users.

Lastly, I recommend an article on how to activate GPTPLUS. If you have the need, you can take a look at it: "https://www.onekey.wiki/post/chatgpt-plus/".

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.