gpt-engineer
gpt-engineer copied to clipboard
Can someone help me with this error ?
File "
File "
File "C:\Users\USER\Desktop\yash\python\gpt-engineer\gpt_engineer\main.py", line 66, in
File "C:\Users\USER\Desktop\yash\python\gpt-engineer\gpt_engineer\main.py", line 29, in main model = fallback_model(model) ^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER\Desktop\yash\python\gpt-engineer\gpt_engineer\ai.py", line 60, in fallback_model openai.Model.retrieve(model)
File "C:\Users\USER\AppData\Roaming\Python\Python311\site-packages\openai\api_resources\abstract\api_resource.py", line 20, in retrieve instance.refresh(request_id=request_id, request_timeout=request_timeout)
File "C:\Users\USER\AppData\Roaming\Python\Python311\site-packages\openai\api_resources\abstract\api_resource.py", line 32, in refresh self.request(
File "C:\Users\USER\AppData\Roaming\Python\Python311\site-packages\openai\openai_object.py", line 172, in request requestor = api_requestor.APIRequestor( ^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER\AppData\Roaming\Python\Python311\site-packages\openai\api_requestor.py", line 138, in init self.api_key = key or util.default_api_key() ^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER\AppData\Roaming\Python\Python311\site-packages\openai\util.py", line 186, in default_api_key raise openai.error.AuthenticationError(
@lonelycoder007 I guess that your authentication key is invalid
@lonelycoder007 I guess that your authentication key is invalid
Authentication Keys**** from that...
all those lines that you inserted your API key into @lonelycoder007 needs to be reviewed that it was properly set with the right value, string, and proper numerical data for the API key.
if so then verify the API has permissions to access the specific endpoints required to be ran by GPT.
But ima just say that you probably inserted the API Keys incorrectly which is leading to this error.
Is there a way to permanently assign the API key cause it asks for every time i run it
Hey @lonelycoder007,
Sure, let's try to make the steps easier to follow with arrows:
Windows + X -> Click on System Advanced system settings Environment Variables in the new window New under System variables Enter OPENAI_KEY in Variable name, and your API key in Variable value Click OK on every window to save your changes This way, the API key becomes part of your system's environment variables and the gpt-engineer script should be able to access it automatically. You won't need to input it each time you run the script.