PaLMLink functions call the PaLM API. As such, they need access to an PaLM API key from the user's account. These can be generated from the account page on the PaLM website, or from https://developers.generativeai.google/products/palm when logged in.
In order to find the API key, PaLMLink first checks
. Finally, if that is not set, it checks for the "PALM_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.
Evaluate $PaLMAPIKey to check if the API key is set
In[24]:=
$PaLMAPIKey
Out[24]=
AI...I
If the API key is not set, it can be set for the current session:
$PaLMAPIKey
="<YOURAPIKEY>";
Alternatively, it can be set persistently for future sessions: