-
Notifications
You must be signed in to change notification settings - Fork 43.1k
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
openai.error.AuthenticationError: Incorrect API key provided #4084
Comments
Check you .env, the key needs to be right after the "=". |
If you're not on the pay as you go pricing plan for the API key on you OpenAI account you will keep getting this error. Leaving the free credit tier is how I fixed this. Edit: let me know if this fixed your problem as well. |
To clarify what @joshduplaa said, there is a difference between platform.openai.com and chat.openai.com, including billing. Both tools manage billing separately. Make sure that you are on platform.openai.com's paid plan. |
It is:
OPENAI_API_KEY=sk-x7Dq6JMVodyPuT(...)
…On 10/05/2023 21:25, k-boikov wrote:
Check you .env, the key needs to be right after the "=".
—
Reply to this email directly, view it on GitHub <#4084 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AFUFRJFM3UNKLNO2X2STMN3XFPTTLANCNFSM6AAAAAAX5CJR5M>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
I have both payments plans set up. The platform.openai.com has a $20 daily limit set.
W.
…On 11/05/2023 01:49, Blue Falcon wrote:
To clarify what @joshduplaa <https://github.com/joshduplaa> said, there is a difference between platform.openai.com and chat.openai.com, including billing. Both tools manage billing separately.
—
Reply to this email directly, view it on GitHub <#4084 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AFUFRJCV7EKWFD6E47QCRADXFQSRZANCNFSM6AAAAAAX5CJR5M>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
I have eventually resolved the problem. The .env file I use is an edited copy of .env.template. In the original template, however, the OPENAI_API_KEY is listed twice, once commented and once uncommented. I edited the first appearance and removed the ### but didn't notice the second appearance. Apparently, after reading the correct api key, the system also reads the second one - incorrect, namely, non-existing - and reports wrong api key. |
Interesting find |
Which Operating System are you using?
Linux
Which version of Auto-GPT are you using?
Latest Release
GPT-3 or GPT-4?
GPT-4
Steps to reproduce 🕹
First installation of recent AutoGPT from GitHub repository, ubuntu, Python 3.10.6
Current behavior 😯
stuck on wrong key (see log)
Expected behavior 🤔
2, 3....
Your prompt 📝
List all prime numbers less than 100
Your Logs 📒
Using Browser: chrome
Traceback (most recent call last):
File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/skaba/autogpt/Auto-GPT/autogpt/main.py", line 5, in
autogpt.cli.main()
File "/home/skaba/autogpt/env/lib/python3.10/site-packages/click/core.py", line 1130, in call
return self.main(*args, **kwargs)
File "/home/skaba/autogpt/env/lib/python3.10/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/home/skaba/autogpt/env/lib/python3.10/site-packages/click/core.py", line 1635, in invoke
rv = super().invoke(ctx)
File "/home/skaba/autogpt/env/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/skaba/autogpt/env/lib/python3.10/site-packages/click/core.py", line 760, in invoke
return __callback(*args, *kwargs)
File "/home/skaba/autogpt/env/lib/python3.10/site-packages/click/decorators.py", line 26, in new_func
return f(get_current_context(), args, kwargs)
File "/home/skaba/autogpt/Auto-GPT/autogpt/cli.py", line 90, in main
run_auto_gpt(
File "/home/skaba/autogpt/Auto-GPT/autogpt/main.py", line 186, in run_auto_gpt
agent.start_interaction_loop()
File "/home/skaba/autogpt/Auto-GPT/autogpt/agent/agent.py", line 113, in start_interaction_loop
assistant_reply = chat_with_ai(
File "/home/skaba/autogpt/Auto-GPT/autogpt/llm/chat.py", line 244, in chat_with_ai
assistant_reply = create_chat_completion(
File "/home/skaba/autogpt/Auto-GPT/autogpt/llm/llm_utils.py", line 166, in create_chat_completion
response = api_manager.create_chat_completion(
File "/home/skaba/autogpt/Auto-GPT/autogpt/llm/api_manager.py", line 55, in create_chat_completion
response = openai.ChatCompletion.create(
File "/home/skaba/autogpt/env/lib/python3.10/site-packages/openai/api_resources/chat_completion.py", line 25, in create
return super().create(args, kwargs)
File "/home/skaba/autogpt/env/lib/python3.10/site-packages/openai/api_resources/abstract/engine_api_resource.py", line 153, in create
response, _, api_key = requestor.request(
File "/home/skaba/autogpt/env/lib/python3.10/site-packages/openai/api_requestor.py", line 226, in request
resp, got_stream = self._interpret_response(result, stream)
File "/home/skaba/autogpt/env/lib/python3.10/site-packages/openai/api_requestor.py", line 619, in _interpret_response
self._interpret_response_line(
File "/home/skaba/autogpt/env/lib/python3.10/site-packages/openai/api_requestor.py", line 682, in _interpret_response_line
raise self.handle_error_response(
openai.error.AuthenticationError: Incorrect API key provided: your-ope-key. You can find your API key at https://platform.openai.com/account/api-keys.
The text was updated successfully, but these errors were encountered: