Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More info for error "Failed to get a response. Have you set the OPENAI_API_KEY variable?" #2

Closed
dylang opened this issue Dec 14, 2022 · 9 comments · Fixed by #20
Closed
Labels
help wanted Extra attention is needed

Comments

@dylang
Copy link

dylang commented Dec 14, 2022

Hi, looking forward to trying this, getting an error though and I'm not sure how to debug it.

The key is freshly made from https://beta.openai.com/account/api-keys.
I'm using fish shell 3.5.1 in MacOS.

 ❯ echo $OPENAI_API_KEY
sk-<key hidden>
 ❯ plz "list files"
✖ Failed to get a response. Have you set the OPENAI_API_KEY variable?

I've yet to try to code in Rust so I'm not set up to try to modify the source and see what's happening.

@yorhodes
Copy link

have the same issue @m1guelpf

@omeb
Copy link

omeb commented Dec 14, 2022

Having the same issue as well...
image

@llunasanz
Copy link

llunasanz commented Dec 14, 2022

Same here (KDE Neon). Also having OPENAI_API_KEY variable persisted

I think that it does not depend on setting OPENAI_API_KEY variable because plz do not let you run a request to OPENAI API without KEY variable. It shows the next message:
This program requires an OpenAI API key to run. Please set the OPENAI_API_KEY environment variable.
IDK if it is related to API permissions or whatever.

@jcortejoso
Copy link

jcortejoso commented Dec 15, 2022

I had problems with API_KEYS from my personal account as my account had not enough credit to make any request. You can confirm if you are able to make requests at https://beta.openai.com/playground (just make a dummy request there).

An API for accessing new AI models developed by OpenAI

@ghost
Copy link

ghost commented Dec 15, 2022

Having the same issue here

@llunasanz
Copy link

llunasanz commented Dec 15, 2022

I tried to provide billing details and set my credit card at OpenAI. Then, I repeated the steps and it worked for me:

image

Thanks to @jcortejoso for the message!

@m1guelpf
Copy link
Owner

Would be really helpful if anyone experiencing this issue could share a copy of the response returned, so I can improve the error message on the CLI

@markkucler
Copy link

markkucler commented Dec 15, 2022

I had the same problem, billing/playground showed "You've reached your usage limit." and it started working once I provided billing details. Thanks @jcortejoso and @llunasanz!

@yorhodes
Copy link

also was just a billing issue for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants