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.
By default, OpenAILink first checks whether the "OPENAI_API_KEY"
for a key. If it 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.