-
Notifications
You must be signed in to change notification settings - Fork 4
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
Can't identify my OPENAI_API_KEY in .env file #52
Comments
Can you post the code you're using? Do you have a global env variable set? %env |
@aldkfjwe Can you please print out |
Same here |
@tolseee can you please print out the environment variable to ensure it's the key you're expecting? Griptape does not automatically load |
I already did it But always get the error above on comfy When I run a OpenAI check on terminal, it gives me this: python check_api_key.py The API is right It seems it doesn't load the right api |
@tolseee are you able to reproduce this issue outside of ComfyUI? That would help us pinpoint whether this is an issue with the integration or griptape. |
Hi @tolseee - in your .env, do you have spaces between OPENAI_API_KEY and the = sign and your key? Does it look like this:
or
|
OPENAI_API_KEY=sk-proj-WKF[...] |
Hmm.. okay.. this is interesting. are you on windows or mac? One thing to try.. in the shell where you're running comfyUI, try and run python by just executing:
This should put you in a shell that looks something like:
Then run:
This should show the default API key set for your environment. If it's the old one, then do:
This will force python to get the keys from your then again do:
Are they the same? The other question.. is your |
This is what I get PS C:\SD[...]\ComfyUI_windows_portable\ComfyUI> python
Yes Honestly I have no idea where the AuthenticationError: Error code: 401 - {'error': {'message': 'Incorrect API key |
Yeah, it's very strange! Okay, here's another thing to try.. in your If you open that file, you should see something that looks like:
is that the right api key? If not, try deleting the griptape_config.json file and restarting comfyui -Jason |
You got it. Now I'm facing a new issue but I'll open a new thread to avoiding off topic posts :) Thank'you so much!! |
I'm running the sample code from Github page and found out it used my old api key that resulted in this error.
I then added my newer API key to the .env file in root file of the project: OPENAI_API_KEY = 'my new version of the key'. However, after I added this line, the code still used older version, instead of the key provided in environment file. Is there any file should I create to configure the API key?
The text was updated successfully, but these errors were encountered: