This article will introduce detailed steps to help you quickly have a privately deployed ChatGPT Web App and explain the proprietary concepts involved.
OpenAI Account Registration#
🏠 Open the website and register: OpenAI
📮 Use your personal email, preferably Gmail
📱 Phone number verification
🙅 This part does not support domestic phone numbers due to regional restrictions
- After completing the registration, recharge in the upper right corner, supporting Alipay, 1 USD is enough
- Choose the 🇮🇳India region to purchase the number (cheaper)
- Enter the purchased virtual number in the OpenAI registration page (do not paste the area code of the virtual number)
- SMS-Activate should display the verification code, enter it into OpenAI (didn't receive it? The amount will be automatically refunded to the balance after 20 minutes)
- 🙆 Successfully verified by the verification code
Generate API Keys#
- 🔑 After successful registration, click on the upper right corner to enter this page, and new users click Create new secret key
- ❗️ This key needs to be properly kept and will be used for deploying your own application later
Related repository: ChatGPT-Vercel
Vercel one-click deployment: Link (recommended to log in with your personal Github account)
Click on the first Github icon, Vercel will associate with your personal Github account, enter the name of the new repository and click Create to clone the repository. Enter the API key to start the deployment.
At this point, we have completed the deployment, and Vercel will automatically assign a domain.
- Configure environment variables
In the previous step, we have set OPENAI_API_KEY before deployment. If you need to change it, there are two options:
- There is a place on the page itself to set it, just fill it in ( this setting has a higher priority than Vercel ).
- Go to Vercel for settings, path Settings / Environment Variables, the field name is OPENAI API KEY, and the value is the API key you created on the OpenAI platform.
(Optional) Custom Domain#
Vercel can add custom domains, path Settings / Domains
Go to the service provider to configure CNAME to take effect.
(Optional) Stay Up-to-Date with the Project#
Since the project we are using is constantly being iterated, if you use the method in step 3 above, Vercel will help you establish an independent private repository directly from the original project at the time of submission. If the original project adds new features or bug fixes, your repository will not be aware of them.
If you want to be able to update to new features and deploy new versions of the application in a timely manner after the original repository is updated, it is recommended that you first go to this repository to fork it, and then go to Vercel to import this forked project for deployment.
If there are new commits in the original repository at this time, Github will prompt you to sync the fork, so that you can update your repository to the latest version, and Vercel will automatically deploy it.
Is API Usage Free and How is it Billed?#
The private deployment mentioned above uses the API service provided by OpenAI, and this is not free. You can see how much quota you have used so far on this page:
The above image shows that our account has a quota of 5 USD, which is valid for 3 months from the registration of the account. The gpt-3.5-turbo model used for API calls is charged at 0.002 USD per 1,000 tokens. That is, it is not charged based on the number of calls. OpenAI will merge the question and answer content of each conversation for calculation. Token calculation can be viewed in this repository or experience the algorithm visually by clicking here.
Are There Other Ways to Use?#
Free! The premise is that you have an OpenAI account. You can also upgrade to ChatGPT Plus for $20 per month. The difference from the free version is that it is more stable, uses updated models, and can guarantee availability even during peak periods. The billing for ChatGPT Plus is separate from API calls.
Billed! Essentially, it still uses the API, so it will consume your quota, and the billing rules are different for different models. The use case is generally for developing specific applications based on the API and can be conveniently used for debugging prompt engineering and providing "examples" (examples of the expected input-output format) in the Playground.
From Usage to Development#
[Translation] Prompt Engineering: Skillful Inducement Read the document
How to Quickly Develop an OpenAI/GPT Application Repository
Node.js client for the official ChatGPT API Repository
Awesome ChatGPT API Repository
ChatGPT Chinese Prompt Guide Repository
Awesome ChatGPT Prompts Repository
Prompt Writing Mode: How to Give a Machine a Mindset Repository