跳转到内容
View in the app

A better way to browse. Learn more.

彼岸论坛

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
欢迎抵达彼岸 彼岸花开 此处谁在 -彼岸论坛

[OpenAI] 尝试通过 Cloudflare Workers 让 Anthropic API 绕过 GFW 时遇到的问题

发表于

如题,我在今年早些时候尝试使用 OpenAI 的 API 时发现国内无法直连,于是借用 Cloudflare Workers 代理顺利避开 IP 检测。需要用到的主要资源是 Cloudflare Worker ,未被黑名单的自有域名,以及合法的 API Key 。 详细步骤参考来源:使用 Cloudflare Workers 让 OpenAI API 绕过 GFW 且避免被封禁 (感谢原作者noobnooc

后来接触到 Claude 之后发现其各方面性能都不错,而且比 ChatGPT 更能满足本人的需要,于是近日打算转用 Anthropic 的 API ,同样无法直连,于是按照上述方法尝试重新建立新的 Worker 用于 Anthropic API 的代理。进行到其中

将 https://gist.github.com/noobnooc/d0407b5fb81cff9d36f981170b99d4e6 里的代码粘贴到 Worker 中并部署

这一步时,我把其中 upstream 的api.openai.com替换为了api.anthropic.com/v1/messages,然而代理部署后却得到了"Not Found"的报错。直接访问api.anthropic.com/v1/messages的话报错信息是"Method Not Allowed",说明至少这个端点是存在的,但代理似乎没法访问到?不太理解,目前就卡在这儿了。

如果各位有兴趣的话可以看看这个方法的具体说明,指点我一下可能是哪个环节的问题,该怎么修改,那就太好了。感激不尽!

(不太清楚这个问题应该放在哪个节点,感觉比起 Cloudflare 更应该是 Anthropic 那边出的问题,Anthropic 没有独立节点所以暂时搁这儿了)

Featured Replies

No posts to show

创建帐户或登录来提出意见

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.