AgentGPT
AgentGPT copied to clipboard
How can I save the API KEY on the server side?
Hello developer,
I deployed AgentGPT successfully through the method of "setup.sh --docker" and it's running normally.
I passed the correct API KEY during the deployment process and checked that the API KEY is also saved in the .env and .env.docker files. However, every time I use AgentGPT, I need to save the API-KEY again in the settings in order to use it, which is not as expected. How can I solve this issue?"

Could you check if the API key is not being overwritten during runtime? Or this might be related somehow. https://github.com/reworkd/AgentGPT/issues/344#issue-1682230369
Hey so setting the API key as your env should be enough. The only thing is, we limit loops for non custom keys. What you can do is go into the code and remove this cap.
Alternatively, we can add a check in the backend to default to a higher value when running in dev mode.
您能否检查 API 密钥在运行时是否未被覆盖? 或者这可能以某种方式相关。第344章(评论)
I received an error stating "ERROR accessing OpenAI APIs. Please check your API key or try again later." The API key that I passed during the service deployment was confirmed to be valid. To use it properly, I have to re-save the API key through the SETTINGS button on the front-end page.
Where should I conduct the inspection, please?

I am having same issue I add api to .env tested both docker and docker-compose and seems by default it is using a default api key from you guys I assume?
It is not using the api key set in .env, also showing to sign in...how? nextuth url and nextauth secrete are set should I be getting a sign in option?
Hey no we don't provide any default API key. Maybe try logging what the key is in the backend and then run through docker? Probably the case that the env is not being picked up properly