代码地址:

  1. https://github.com/acheong08/ChatGPT-Proxy-V1

复制代码



创建文件:internal\handlers\config.json

内容为:

  1. {
  2.     “Endpoint”: “https://api.openai.com”
  3. }

复制代码



internal\handlers\server.go  36行修改为:

  1. url := Config.Endpoint  + c.Param(“path”)

复制代码



编译:

  1. set GOOS=linux
  2. set GOPACH=amd64
  3. go build

复制代码



上传至服务器
执行

  1. chomod 777 文件名
  2. ./文件

复制代码



宝塔设置


附上一个反代地址:api.aizhineng.cc