-
Notifications
You must be signed in to change notification settings - Fork 44.5k
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
Not recognizing my OpenAI API #644
Comments
Have you set up billing on your OpenAI account? |
I'd like to say that I'm having the same issue and I have set up billing. |
Do you have quotes around the key in .env ? (If so try removing) |
try this command maybe it will help you to cache: pip cache purge |
a quick way to validate the API key you use in .env is by running:
if successful, it will return what models are available to your subscription. |
I don't think this did anything for me, unfortunately.
I put in the key I'm using in my Can other people with the same issue chime in? |
OK, we've established your API key is fine. What version of Python are you running?
What version of openai is installed?
|
|
Fairly recent Python release, recent openai. Latest openai is 0.72.4, but I'm on 0.72.2 too, without any errors. |
I reran |
see if you could jump on Discord https://discord.com/channels/1092243196446249134/1092243197117337677 and we can try a few ideas to get to the bottom of it |
@onekum try |
yeah - been set up for awhile. |
@onekum strace lets you see all the system calls made at execution, useful options can be found in the manual. It appears only the pinecode API are read from .env in the strace and you've got an "write(2, "openai.error.AuthenticationError"..., 190) = 190" It worked when you tried calling the API with your API directly, so the app is not picking it up correctly. just to rule out any environment issues, please try carefully with a
Usually, it is not ideal to put strace logs in public, hence my suggestion to take it to Discord and then DM based ping-pong. |
Noted; I made sure there wasn't any personal information in the strace log. I'll do what you suggested, thanks. |
This seems ot have resolved itself for me. My guess is it was some issue on the OpenAI key |
A lot of folks forget to rename the file and get the same error. |
@onekum strace lets you know see all the system calls made at execution, useful options can be found in the manual. It appears only the pinecode API are read from .env in the strace and you've got an "write(2, "openai.error.AuthenticationError"..., 190) = 190" It worked when you tried calling the API with your API directly, so the app is not picking it up correctly. just to rule out any environment issues, please try carefully with a
Usually, it is not ideal to put strace logs in public, hence my suggestion to take it to Discord and then DM based ping-pong.
@onekum got it working? |
Like timkite76, it seems to have resolve itself. I didn't do anything in particular on my system to resolve it, though, so I'd be hard pressed to tell what the issue was. I did do the hard git reset, but that was yesterday and it still didn't work after the fact, so I have no idea why it works now. |
Check the .sourcery file and erase (.env) under : :) |
Duplicates
Steps to reproduce 🕹
I input my OpenAI API key in the .env but when I run main.py, i can set up the agent, set 5 goals, but then it throws off the following error:
openai.error.AuthenticationError: Incorrect API key provided: sk-dLjLf***************************************PcFj. You can find your API key at https://platform.openai.com/account/api-keys.
I have tried several new openai api keys - all with the same result
Current behavior 😯
No response
Expected behavior 🤔
No response
Your prompt 📝
# Paste your prompt here
The text was updated successfully, but these errors were encountered: