可以将网络上的 ChatGPT 转换为 OpenAI API 格式的服务。
Go to file
2024-04-05 06:11:42 +08:00
api init first commit 2024-04-05 04:58:52 +08:00
chatgpt fix nothing 2024-04-05 06:11:42 +08:00
utils fix nothing 2024-04-05 06:11:42 +08:00
chat2api.py fix nothing 2024-04-05 06:11:42 +08:00
docker-compose.yml upload README 2024-04-05 05:11:25 +08:00
Dockerfile init first commit 2024-04-05 04:58:52 +08:00
LICENSE upload README 2024-04-05 05:11:25 +08:00
README.md fix nothing 2024-04-05 06:11:42 +08:00
requirements.txt init first commit 2024-04-05 04:58:52 +08:00

CHAT2API

免费的GPT3.5 api

仅ip属地支持免登录使用ChatGpt可以使用

Deploy

直接部署

git clone https://github.com/LanQian528/chat2api
cd chat2api
pip install -r requirements.txt
python chat2api.py

Docker部署

您需要安装Docker和Docker Compose。

docker run -d \
  --name chat2api \
  -p 5005:5005 \
  lanqian528/chat2api:latest

Docker Compose部署

创建一个新的目录例如chat2api并进入该目录

mkdir chat2api
cd chat2api

在此目录中下载库中的docker-compose.yml文件

docker-compose up -d

Usage

curl --location 'http://127.0.0.1:5005/v1/chat/completions' \
--header 'Content-Type: application/json' \
--data '{
     "model": "gpt-3.5-turbo",
     "messages": [{"role": "user", "content": "Say this is a test!"}],
     "stream": true
   }'

高级设置

默认情况不需要设置,除非你有需求

环境变量

PROXY_URL=http://username:password@proxy:port
CHATGPT_BASE_URL=https://chat.openai.com/backend-anon
HISTORY_DISABLED=true

License

MIT License