部署 Vercel 设置 OPENAI_API_KEY 环境变量无效
部署 Vercel 设置 OPENAI_API_KEY 环境变量无效。只能在前端设置 API KEY,但是这样的话 KEY 只有保存在本地。难道这个项目不支持在服务端设置 API KEY?
请提供 vercel 控制台 log 截图。
看不出什么有用的东西
修改完环境变量重新部署 vercel 了没?
重新部署试过,删了项目重新部署也试过。都不行
- 提供一下环境变量页的截图
- 确认 api key 可用?
确认可用哦,因为我在前端填 API KEY 就可以用

我试过 fork 部署,以及直接点你这个项目deploy 按钮部署都不行
是否在设置页填写了你自己设置的 CODE? 请提供设置页截图。
把你的 CODE 填到 Access Code 上去。
啊?Code 原来是这个意思?若然可以了。 我以为设置了 CODE的话,前端会弹出一个什么输入密码的框框。
这个code值是什么?在哪里获取
我设置了CODE,在前台也重新输入CODE,但依然不行,必须在前台输入API KEY才可以。唉,不知道为什么vercel已经设置了环境变量,前台还要输入一次KEY,好麻烦。
Bot detected the issue body's language is not English, translate it automatically.
I set the CODE and re-enter the CODE in the front desk, but it still doesn't work. You must enter the API KEY in the front desk. Alas, I don’t know why vercel has already set the environment variable, and the front desk needs to enter the KEY again, which is very troublesome.
{ "error": { "message": "Incorrect API key provided: Incorrec**************ided. You can find your API key at https://platform.openai.com/account/api-keys.", "type": "invalid_request_error", "param": null, "code": "invalid_api_key" } } 这个报错是为啥啊
我的api可以在其他地方使用但是这里使用就显示这个问题
Bot detected the issue body's language is not English, translate it automatically.
My api can be used elsewhere but when used here it shows this problem
不知道为啥api在这里用不了
Bot detected the issue body's language is not English, translate it automatically.
I don’t know why the API can’t be used here