Trying to get an API key from an environment variable placed in “.zshrc” when running the Python script in BBEdit. Turns out that for non-interactive shells, environment variables should be exported from the “.zshenv”. This was all documented on the BBEdit website.