diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..a9e94de --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 aurora-develop + +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 restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, 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. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..ff299eb --- /dev/null +++ b/README.md @@ -0,0 +1,70 @@ +# CHAT2API + +免费的GPT3.5 api + +### 注:仅ip属地支持免登录使用ChatGpt可以使用 + +## Deploy + +### 直接部署 + +```bash +git clone https://github.com/LanQian528/chat2api +cd chat2api +pip install -r requirements.txt +python chat2api.py +``` + +### Docker部署 +您需要安装Docker和Docker Compose。 + +```bash +docker run -d \ + --name chat2api \ + -p 5005:5005 \ + lanqian528/chat2api:latest +``` + +### Docker Compose部署 +创建一个新的目录,例如chat2api,并进入该目录: +```bash +mkdir chat2api +cd chat2api +``` +在此目录中下载库中的docker-compose.yml文件: + +```bash +docker-compose up -d +``` + +## Usage + +```bash +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 +``` + +[//]: # (## 鸣谢) + +[//]: # () +[//]: # (感谢各位大佬的pr支持,感谢。) + +## License + +MIT License diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..ac776a0 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,13 @@ +version: '3' + +services: + app: + image: lanqian528/chat2api:latest + container_name: chat2api + restart: unless-stopped + ports: + - '5005:5005' +# environment: +# - PROXY_URL=http://username:password@proxy:port +# - CHATGPT_BASE_URL=https://chat.openai.com/backend-anon +# - HISTORY_DISABLED=true