OpenInterpreter / open-interpreter

A natural language interface for computers
http://openinterpreter.com/
GNU Affero General Public License v3.0
50.54k stars 4.4k forks source link

Open Interpreter can't identify API key in .zshrc file #1328

Open aldkfjwe opened 4 days ago

aldkfjwe commented 4 days ago

Is your feature request related to a problem? Please describe.

I'm running the command interpreter --os and type in a question regarding time in Berkeley. Then, I got this error

**openai.openaiError: The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable

There might be an issue with your API key(s).

To reset your API key (we'll use OPENAI_API_KEY for this example, but you may need to reset your ANTHROPIC_API_KEY, HUGGINGFACE_API_KEY, etc): Mac/Linux: 'export OPENAI_API_KEY=your-key-here'. Update your ~/.zshrc on MacOS or ~/.bashrc on Linux with the new key if it has already been persisted there., Windows: 'setx OPENAI_API_KEY your-key-here' then restart terminal.**

Before that, I add the api key to .zshrc file and it looks like this: **export OPENAI_API_KEY=*

Describe the solution you'd like

Because I add api key to .zshrc, it should work by now according to the error.

Describe alternatives you've considered

I've tried to use several User API keys and Project API keys. None of them work. I also use sudo to run the command. It also doesn't work. I really don't know why this happens.

Additional context

No response

adriens commented 20 hours ago

Hi, did you try to put it this way in your .zshrc :

# OPENAI
export OPENAI_API_KEY="sk-*****"
kasjfksj commented 13 hours ago
image

I've already done it. But still can't identify the key. It still reports "There might be an issue with your API key(s)."