Status: [LIVE]
Endpoints found:
https://cdn.jsdelivr.net/gh/x-dr/chatgptProxy
https://api.star-history.com/svg?repos=x-dr/chatgptProxyAPI&type=Date)](https://star-history.com/#x-dr/chatgptProxy
https://cdn.jsdelivr.net/gh/x-dr/chatgptProxyAPI@main/cf_worker.js
Source: https://github.com/yuan-666/openaiProxyAPI
*经测试有些ip访问时会显示下图*
---
### Demo
[https://chatai.451024.xyz](https://chatai.451024.xyz)
> api
```url
https://openai.451024.xyz
```
```url
https://openai-proxy-api.pages.dev/api
```
***
> 新项目 [基于OpenAI的微信机器人](https://github.com/x-dr/wechat-bot)
***
### 演示站为公共服务,如有大规模使用需求请自行部署,演示站有点不堪重负

## 利用Cloudflare Worker中转api.openai.com
1. 新建一个 Cloudflare Worker
2. 复制 [cf_worker.js](https://cdn.jsdelivr.net/gh/x-dr/chatgptProxyAPI@main/cf_worker.js) 里的代码粘贴到 Worker 中并部署
3. 给 Worker 绑定一个没有被墙的域名
4. 使用自己的域名代替 api.openai.com
**[详细教程](./docs/cloudflare_workers.md)**
***
## 使用CloudFlare Pages进行中转
### 1、部署中转API+ Openai API余额查询 (使用sess-xxxx的Authorization查询,有效时间未知)
> [官方文档](https://developers.cloudflare.com/pages)
1. ~~Fork本项目~~ 点击[Use this template](https://github.com/x-dr/chatgptProxyAPI/generate)按钮创建一个新的代码库。
2. 登录到[Cloudflare](https://dash.cloudflare.com/)控制台.
3. 在帐户主页中,选择`pages`> ` Create a project` > `Connect to Git`
4. 选择你 Fork 的项目存储库,在`Set up builds and deployments`部分中,全部默认即可。
5. 点击`Save and Deploy`部署,然后点`Continue to project`即可看到访问域名
> 把官方接口的`https://api.openai.com`替换为`https://xxx.pages.dev` 即可
**Demo**
[https://chatai.451024.xyz](https://chatai.451024.xyz)
**[详细教程](./docs/cloudflare_pages.md)**
### 2、只部署中转API
**[详细教程](./docs/cloudflare_proxy_pages.md)**
## docker 部署(要境外vps)
> 好像不支持sse 所以不建议