0xacx / chatGPT-shell-cli

Simple shell script to use OpenAI's ChatGPT and DALL-E from the terminal. No Python or JS required.
https://gptshell.cc
MIT License
1.05k stars 151 forks source link

changing openai api key not working #116

Closed hadster2023 closed 1 year ago

hadster2023 commented 1 year ago

hi, i am using chatgpt shell cli in termux , i have consumed quota of my api key , so i changed it with a new free api key in bash.bashrc. but i am still getting this error "Your request to Open AI API failed: insufficient_quota You exceeded your current quota, please check your plan and billing details.". i am using chatgpt.sh i dont have root.

0xacx commented 1 year ago

If you installed this with the installation script, then the key should be in ~/.profile or ~/.bash_profile, or ~/.zprofile if you have zsh installed. So you should locate the OPENAI_KEY=$your_old_key in one of these files and replace it with your new key. I think the default profile for Android is ~/.profile so check there first. If you installed the script manually, then you should remember or find out where you set the key and replace it there.

As a last resort, If you don't have root access to change profile files, then you could just set the key in the chatgpt.sh file by adding OPENAI_KEY=$your_new_key on top. Note that keeping secrets inside scripts is definitely not a good practice and I wouldn't recommend that.

hadster2023 commented 1 year ago

its probably a openai server thing because i tried , installing everything fresh , and exporting the new api key , still getting quota exceeded message.