Skip to content

justjavac/openai-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenAI/ChatGPT 免翻墙代理

据很多网友反应,OpenAI 检测到中国的 API 访问时,会直接封号。所以我在国外的服务器上搭建了一个代理,用于访问 OpenAI/ChatGPT 的 API。


⚠️⚠️⚠️⚠️⚠️⚠️
由于 https://closeai.deno.dev 访问量巨大,已经超过了 Deno Deploy 的额度,本代理暂时关闭,请大家参照教程自行部署。
⚠️⚠️⚠️⚠️⚠️⚠️

自己部署

Deno

点击这个链接,可以快速一键部署到 Deno Deploy 上。

然后在 Settings 选项卡里可以设置自定义二级域名,或者绑定自己的域名。

或者,访问 https://deno.new 域名,把 deno.ts 复制到 Playground 中,点击 Play 按钮。

CloudFlare

将 cloudflare.ts 复制到 CloudFlare Workers 中。

使用

使用 OpenAI/ChatGPT 官方 npm 包:

import { Configuration } from "openai";

const configuration = new Configuration({
  apiKey: OPENAI_API_KEY,
+ basePath: "https://xxxxx.deno.dev/v1",
});

使用 OpenAI/ChatGPT 官方 Python 包:

  import openai

  openai.api_key = os.getenv("OPENAI_API_KEY")
+ openai.api_base = "https://xxxxx.deno.dev/v1"

相关仓库

本地开发

deno run --allow-net --allow-read --allow-env --watch deno.ts

About

OpenAI/ChatGPT 免翻墙代理

Resources

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •  
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy