Official website has been walled [mirrored] | Privacy deployment | Configuration
If you cannot access the official website https://chatgpt-next.com, you can try to access the mirror site https://1.caninae.com, or backup the URL, or privately deploy it.
When deploying privately, it is best not to include the words chat, gpt, ai, etc. in the domain name, otherwise it will be easily detected by the wall.
docker run --name chatgpt-next -d -p 3000:3000 -e OPENAI_API_KEY_ALIAS xcatliu/chatgpt-next:latest
# --name 容器名称,-d 后台运行,-p 端口映射,-e 透传环境变量npx chatgpt-next -- -p 3000
# -- 后面的参数会透传给 next start,比如 -p 可以指定端口,默认端口是 3000
# 使用 pm2 后台运行
npx pm2 start --name chatgpt-next npx -- chatgpt-next -- -p 3000The following table records all environment variable configurations, and some more complex configurations are explained separately later.
| Environment variables | describe | default value |
|---|---|---|
OPENAI_API_KEY_ALIAS | apiKey alias | null |
CHATGPT_NEXT_DISABLE_PUBLIC | Forbid strangers to access through his own apiKey | false |
CHATGPT_NEXT_API_HOST | Configure the host (including port) for API requests | api.openai.com |
Configure the environment variable OPENAI_API_KEY_ALIAS to support apiKey alias.
Use | to separate multiple aliases configurations, each aliases configuration uses : to separate aliases and real apiKeys, for example:
OPENAI_API_KEY_ALIAS="firstkey:sk-********FUt3|secondkey:sk-********f1J3"
According to the above configuration, if the user enters firstkey in the pop-up window of the opening page, he will send the request as the first apiKey, and if secondkey is entered, he will send the request as the second apiKey.
The link supports bringing api-key directly to share it with friends more conveniently, such as:
https://chatgpt-next.com/?api-key=firstkey
You need to install the Node.js environment first, you can download and install it on the official website.
# 安装依赖
npm i -g pnpm
pnpm i
# 本地开发
pnpm dev
# 构建
pnpm build
# 启动
pnpm startDirect request of OpenAI interface in China may result in a ban, so the request was skipped in the dev environment. To send a request, comment out the relevant code in the app/api/chat/route.ts file.
Use whistle to conveniently capture packets and proxy API requests to the existing network.
The following is the whistle configuration during local development:
chatgpt-next.com/api ignore://*
chatgpt-next.com 127.0.0.1:3000
If you have also deployed a site and are willing to make it public, welcome to PR!
MIT, just use it, remember to help me promote it more.
If you feel it has helped you, please invite me to have a cup of coffee☕️.
MIT License
Copyright (c) 2023 xcatliu
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restrictions, including without limitation the rights to use, copy, modify, merge, publish, distribution, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.