gpt_academic icon indicating copy to clipboard operation
gpt_academic copied to clipboard

[feature]使用cloudflare解决openai api无法访问的问题

Open banditsmile opened this issue 1 year ago • 2 comments

  1. 参考https://github.com/x-dr/chatgptProxyAPI 通过cloudflare配置一个openai api的proxy
  2. 修改config.py里面的API_URL_REDIRECT配置,将reverse-proxy-url换成你在cloudflare里面配置的域名
# 举例: API_URL_REDIRECT = {"https://api.openai.com/v1/chat/completions": "https://reverse-proxy-url/v1/chat/completions"}
API_URL_REDIRECT = {}

这样就可以以最低的成本使用openai api了

banditsmile avatar Dec 12 '23 15:12 banditsmile

非常好的点子

binary-husky avatar Dec 13 '23 08:12 binary-husky

https://developers.cloudflare.com/ai-gateway/

这个gateway也行

liongkj avatar Dec 19 '23 06:12 liongkj