Aitrainee | 公众号:AI进修生
🌟免责声明:本文仅用于技术研究和学习,根据《生成式人工智能服务管理暂行办法》的要求,请勿对公众提供一切未经备案的生成式人工智能服务。任何个人、团队和企业,无论以何种方式使用这些项目、对何对象提供服务,所产生的一切后果,本文作者均不承担任何责任。
Github:https://github.com/lanqian528/chat2api/
实现 Chat2Api 逆向项目合集(3.5版)
ChatGPT 宣布无需登录即可使用,因此网上出现了利用免登录的 ChatGPT 网页提供免费 GPT-3.5-Turbo API 服务的方法,这使我们可以在 LangChain、划词翻译等服务中顺畅地使用这些功能。
然而,这些方法目前仅支持 gpt-3.5-turbo 模型和 completions 接口,需要部署在能访问 ChatGPT 网页版的环境中。
https://github.com/aurora-develop/aurora
https://github.com/aurora-develop/free-gpt3.5-2api
https://github.com/LanQian528/chat2api
https://github.com/aurorax-neo/free-gpt3.5-2api
https://github.com/k0baya/FreeGPT35-Glitch
https://github.com/PawanOsman/ChatGPT
https://github.com/xsigoking/chatgpt-free-api
https://github.com/missuo/FreeGPT35
https://github.com/cliouo/FreeGPT35-Vercel
已实现的功能
配置环境变量 AUTHORIZATION
,启动程序后访问 /tokens
或 /api_prefix/tokens
查看或管理 Tokens。在请求时传入 AUTHORIZATION
配置的值进行多账号轮询。
设置环境变量来配置程序。每个变量都有默认值,谨慎设置,避免传空值。
分类 | 变量名 | 示例值 | 默认值 | 描述 |
---|---|---|---|---|
安全相关 | API_PREFIX | your_prefix | None | 设置 API 前缀密码,避免被人访问 |
AUTHORIZATION | your_authorization | [] | 设置的授权,支持多账号轮询 | |
AUTH_KEY | your_auth_key | None | 私人网关需要加auth_key请求头 |
git clone https://github.com/LanQian528/chat2api
cd chat2api
pip install -r requirements.txt
python app.py
docker run -d --name chat2api -p 5005:5005 lanqian528/chat2api:latest
mkdir chat2api
cd chat2api
wget https://raw.githubusercontent.com/LanQian528/chat2api/main/docker-compose.yml
docker-compose up -d
访问 http://127.0.0.1:5005
使用免登录 GPT-3.5。使用 API 时传入 AccessToken 或 RefreshToken,可使用 GPT-4, GPT-4o 和 GPTs。
curl --location 'http://127.0.0.1:5005/v1/chat/completions' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{OpenAI APIKEY}}' \
--data '{
"model": "gpt-3.5-turbo",
"messages": [{"role": "user", "content": "Say this is a test!"}],
"stream": true
}'
知音难求,自我修炼亦艰
抓住前沿技术的机遇,与我们一起成为创新的超级个体