Setting up an API Key in the MacOS terminal, for beginner

18 views Asked by At

I am completely new, bear with me.

I have Python 3.11.4 installed on my Mac.

According to the OpenAI Quickstart guide, I must install the OpenAI Python library by running pip install --upgrade openai in my terminal. (Side note, I'm using the Terminal from the spotlight search on Mac. When launching Jupyter Notebook via Anaconda, another terminal that pops up, which I haven't been touching, not sure if I need to.)

Next it says to set up your API Key (for all projects or just a single project). I have my API Key.

I run the command: nano ~/.zshrc

I am supposed to paste this line: export OPENAI_API_KEY='my_api_key_here'

Where do I paste that in? Please see the screenshot of my terminal when running nano ~/.zshrc and point to where it should go. Or maybe there is another way of doing this? I can't get the Ctrl+O to write the changes after pasting the given line.

terminal screenshot

0

There are 0 answers