1
0

complete readme

This commit is contained in:
David xu 2023-05-22 14:34:44 +08:00 committed by GitHub
parent b264b048fe
commit dadb8949c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 58 additions and 2 deletions

View File

@ -1,5 +1,5 @@
# ChatGPT-to-API
Create a fake API using ChatGPT's website
Create a fake API using ChatGPT's website [中文说明](https://github.com/xqdoo00o/ChatGPT-to-API/blob/master/README_ZH.md)
**API endpoint: http://127.0.0.1:8080/v1/chat/completions.**

56
README_ZH.md Normal file
View File

@ -0,0 +1,56 @@
# ChatGPT-to-API
从ChatGPT网站模拟使用API
**模拟API地址: http://127.0.0.1:8080/v1/chat/completions.**
## 使用
### 设置
配置账户邮箱和密码自动生成和更新Access tokens使用[OpenAIAuth](https://github.com/acheong08/OpenAIAuth/)
`accounts.txt` - 存放OpenAI账号邮箱和密码的文件
格式:
```
邮箱:密码
邮箱:密码
...
```
所有登录后的Access tokens会存放在`access_tokens.json`
每20天自动更新Access tokens
注意! 请使用未封锁的ip登录账号请先打开浏览器登录`https://chat.openai.com/`以检查ip是否可用
## 开始
```
git clone https://github.com/xqdoo00o/ChatGPT-to-API
cd ChatGPT-to-API
go build
./freechatgpt
```
### 环境变量
- `PUID` - Plus账户可在`chat.openai.com`的cookies里找到用于绕过cf的频率限制
- `SERVER_HOST` - 默认127.0.0.1
- `SERVER_PORT` - 默认8080
### 可选文件配置
- `proxies.txt` - 存放代理地址的文件
```
http://127.0.0.1:8888
socks5://127.0.0.1:9999
...
```
- `access_tokens.json` - 一个存放Access tokens JSON数组的文件 (可使用 PATCH请求更新Access tokens [correct endpoint](https://github.com/acheong08/ChatGPT-to-API/blob/master/docs/admin.md))
```
["access_token1", "access_token2"...]
```
## 用户管理文档
https://github.com/acheong08/ChatGPT-to-API/blob/master/docs/admin.md
## API使用说明
https://platform.openai.com/docs/api-reference/chat