OpenAILink functions call the OpenAI API. As such, they need access to an OpenAI API key from the user's account. These can be generated from the account page on the OpenAI website, or from https://beta.openai.com/account/api-keys when logged in.
In order to find the API key, OpenAILink first checks
. Finally, if that is not set, it checks for the "OPENAI_API_KEY" environment variable. If Wolfram Language was not launched from a command line, it may not have access to many environment variables set in ~/.bash_profile, etc.