From e36311ba44a033dc0576c4e2bb4c23c5fb73173b Mon Sep 17 00:00:00 2001 From: BlueSkyXN <63384277+BlueSkyXN@users.noreply.github.com> Date: Mon, 29 May 2023 11:23:29 +0800 Subject: [PATCH] Update Docs Update More Docs --- README.md | 2 ++ README_CN.md | 11 +++++++++-- docs/Docker_CN.md | 14 +++++++++++++- docs/TOKEN_CN.md | 24 ++++++++++++++++++++++++ 4 files changed, 48 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8f4765d..d596c25 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,8 @@ Create a fake API using ChatGPT's website **API endpoint: http://127.0.0.1:8080/v1/chat/completions.** +[中文文档(Chinese Docs)](README_CN.md) + ## Help needed - Documentation. diff --git a/README_CN.md b/README_CN.md index 2fe1cea..5810e40 100644 --- a/README_CN.md +++ b/README_CN.md @@ -1,11 +1,12 @@ # ChatGPT-to-API 创建一个模拟API(通过ChatGPT网页版) -本中文手册由 @BlueSkyXN 编写 +本中文手册由 [@BlueSkyXN](https://github.com/BlueSkyXN) 编写 -**API endpoint: http://127.0.0.1:8080/v1/chat/completions.** +[英文文档(English Docs)](README.md) + ## 认证和各项准备工作 在使用之前,你需要完成一系列准备工作 @@ -37,6 +38,12 @@ PUID,就是Personal User ID。这是这个项目中一个特色,其他项目 注意,启动之前你需要配置 yml 配置文件,主要是端口和环境变量,各项参数、用法请参考 [中文指导手册](docs\GUIDE_CN.md) +最后的API端点(Endpoint)是 + +```http://127.0.0.1:8080/v1/chat/completions``` + +注意域名/IP和端口要改成你自己的 + ### 环境变量 - `PUID` - 用户ID - `http_proxy` - SOCKS5 或 HTTP 代理 `socks5://HOST:PORT` diff --git a/docs/Docker_CN.md b/docs/Docker_CN.md index 82c8f8d..49a236f 100644 --- a/docs/Docker_CN.md +++ b/docs/Docker_CN.md @@ -41,6 +41,17 @@ ```docker-compose --version``` +启动容器 + +```docker-compose up -d``` + +关闭容器 + +```docker-compose down``` + +查看容器(如果启动了这里没有说明启动失败) + +```docker ps``` # ChatGPT-TO-API的Docker-Compase文件 @@ -60,4 +71,5 @@ - 这里的ports,左边是外部端口,用于外部访问。右边的Docker端口,需要匹配下面程序设置的监听Port。 - 如果参数`API_REVERSE_PROXY`为空,则默认的请求URL为`https://chat.openai.com/backend-api/conversation`,并且需要提供PUID。PUID的获取参考 [README_CN.md](README_CN.md) -- 这个密码需要自定义,我们构建请求的时候需要它来鉴权。默认是```TotallySecurePassword``` \ No newline at end of file +- 这个密码需要自定义,我们构建请求的时候需要它来鉴权。默认是```TotallySecurePassword``` + diff --git a/docs/TOKEN_CN.md b/docs/TOKEN_CN.md index e69de29..4f61572 100644 --- a/docs/TOKEN_CN.md +++ b/docs/TOKEN_CN.md @@ -0,0 +1,24 @@ +# 获取Token +--- +# 参考Pandora项目的作者指导 + +https://github.com/pengzhile/pandora + +获取Token的技术原理 https://zhile.io/2023/05/19/how-to-get-chatgpt-access-token-via-pkce.html + +## 第三方接口获取Token +http://ai.fakeopen.com/auth + +你需要在这个新的网站的指导下安装浏览器插件,官方说明的有效期是14天。支持谷歌微软等第三方登录。(我谷歌注册的OpenAI就可以用这个) + +## 官网获取 Token +https://chat.openai.com/api/auth/session + +打开后是个JSON,你需要先登录官方的ChatGPT网页版。里面有一个参数就是AccessToken。 + +# 参考go-chatgpt-api项目的作者指导 +https://github.com/linweiyuan/go-chatgpt-api + +ChatGPT 登录(返回 accessToken)(目前仅支持 ChatGPT 账号,谷歌或微软账号没有测试) + +```POST /chatgpt/login``` \ No newline at end of file