[Q&A] openai 的接口问什么要从 vercel 服务端绕一圈? #728
-
🧐 问题描述 | Proposed Solution能直接从浏览器发送请求应该会好点吧 类似 ChatGPT-Next-Web 的方式 📝 补充信息 | Additional InformationNo response |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 17 replies
-
两方面。一方面是服务端可以隐藏key。如果直接在前端发请求,那么apikey会暴露,这个是很多人不希望的。 另一方面,只要服务器位置得当,就可以做到直连openai,不用魔法或者三方代理。 最后, chat next 应该默认也是用的服务端请求。 |
Beta Was this translation helpful? Give feedback.
-
Both aspects. On the one hand, the server can hide the key. If you send a request directly to the front end, the apikey will be exposed, which many people don't want. On the other hand, as long as the server is located properly, you can directly connect to openai without the need for magic or third-party agents. Finally, chat next should also use server requests by default. |
Beta Was this translation helpful? Give feedback.
-
如果实在前端输入key的话 也要经过服务端中转么 |
Beta Was this translation helpful? Give feedback.
两方面。一方面是服务端可以隐藏key。如果直接在前端发请求,那么apikey会暴露,这个是很多人不希望的。
另一方面,只要服务器位置得当,就可以做到直连openai,不用魔法或者三方代理。
最后, chat next 应该默认也是用的服务端请求。