https://ai.google.dev/gemini-api/docs/api-key#macos---zsh
For initial testing, you can hard code an API key, but this should only be temporary since it is not secure. The rest of this section goes through how to set up your API key locally as an environment variable with different operating systems.
Zsh is a common Linux and macOS terminal configuration. You can check if you have a configuration file for it by running the following command:
~/.zshrc