ChatGPT 3.5 api chatGPT privatization deployment

One-click deployment of your own customized chatgpt web program, ChatGPT3.5 API service (that is, the model used on the OpenAI webpage), which allows multiple ChatGPT accounts to work together and build an external API interface service.


The PHP version calls the API interface of OpenAI

The PHP version calls OpenAI’s API interface for Q&A Demo, and the code has been updated to call the latest gpt-3.5-turbo model. It adopts Stream flow mode communication and outputs while generating, and the response speed exceeds the official website. The front end adopts JS EventSource, typeset the text in Markdown format, and colorizes the code. The server keeps a log of all visitors’ conversations.

Many people want to enter the API-KEY function in the Demo website, and the code has already been added, just uncomment the index.php. For the sake of beauty, you can comment out the “continuous dialogue” part above, otherwise, the mobile phone access is not very friendly.

Accessing the new interface of OpenAI in China will prompt a timeout. If you have HTTP-PROXY locally, you can comment out “curl_setopt($ch, CURLOPT_PROXY,” “);” in stream.php Modify it so that you can access the openai interface through your local proxy.

other versions


  1. run with docker

This project is chatgpta privatized deployment, based on fastapi vue3 chatgpt apiimplementation.

quick start

The first method: download the binary directly (suitable for students who do not know programming)

For non-technical personnel, please directly download the compressed package in the release , select the appropriate compressed package according to your own system and architecture, and directly decompress and run it after downloading.

After downloading, unzip it locally, you can see the executable program and the configuration file:

  1. # windows
  2. 1.下载压缩包解压
  3. 2.复制文件中更改为config.json
  4. 3.config.json中的api_key替换为自己的
  5. 4.双击exe运行,启动服务
  6. # linux
  7. $ tar xf chatgpt-web-v0.0.2-darwin-arm64.tar.gz # 解压
  8. $ cd chatgpt-web-v0.0.2-darwin-arm64
  9. $ cp # 根据情况调整配置文件内容
  10. $ ./chatgpt-web # 直接运行
  11. # 如果要守护在后台运行
  12. $ nohup ./chatgpt-web &> run.log &
  13. $ tail -f run.log

The second type: run based on source code (suitable for students who understand go language programming)

  1. # 获取项目
  2. $ git clone
  3. # 进入项目目录
  4. $ cd chatgpt-web
  5. # 复制配置文件
  6. $ copy config.json
  7. # 启动项目
  8. $ go run main.go

run with docker

You can run this project quickly with docker.

The first: run based on environment variables

  1. # 运行项目,环境变量参考下方配置说明
  2. $ docker run itd name chatgptweb restart=always \
  3. e APIKEY=换成你的key \
  4. e MODEL=gpt3.5turbo0301 \
  5. e BOT_DESC=你是一个AI助手,我需要你模拟一名温柔贴心的女朋友来回答我的问题. \
  6. e MAX_TOKENS=512 \
  7. e TEMPREATURE=0.9 \
  8. e TOP_P=1 \
  9. e FREQ=0.0 \
  10. e PRES=0.6 \
  11. e PROXY=http://host.docker.internal:10809 \
  12. e AUTH_USER= \
  13. e AUTH_PASSWORD= \
  14. p 8080:8080 \
  15. addhost=host.docker.internal:host-gateway \
  16. qingshui869413421/chatgptweb:latest

注意: host.docker.internalIt will point to the IP of the host where the container is located, so you only need to change the port to your proxy port.

For the configuration file mapped in the run command, refer to the description of the configuration file below.

The second method: mount and run based on the configuration file

  1. # 复制配置文件,根据自己实际情况,调整配置里的内容
  2. $ cp config.json # 其中 从项目的根目录获取
  3. # 运行项目
  4. $ docker run itd name chatgptweb v `pwd`/config.json:/app/config.json p 8080:8080 qingshui869413421/chatgptweb:latest

The configuration file refers to the description of the configuration file below.

Obtain an OpenAI account (email) and password

  • Click to register for OpenAI

Related Articles

How to Create Your Own Custom GPT?

Creating a tailored GPT assistant is easy and doesn't require any coding knowledge. Here are the steps: Open the ChatGPT...
Read more
How to access ChatGPT-4 How to use GPT-4 for free? Currently, there is no free version of GPT-4, and it is...
Instruct verbs are the first word in the prompt. They are used to instruct the model to do something. They...