GreyDGL / PentestGPT

A GPT-empowered penetration testing tool
MIT License
7.28k stars 883 forks source link

Unable to run PentestGPT #199

Closed Khayla-Dawson closed 7 months ago

Khayla-Dawson commented 8 months ago

I keep receiving the following errors after running command pentestgpt-connection:

root@DESKTOP-1VIBRMA:~/PentestGPT# pentestgpt-connection Your CHATGPT_COOKIE is not set. Please set it in the environment variable. You're testing the connection for PentestGPT v 0.11.0

Test connection for OpenAI api (GPT-4)

Traceback (most recent call last): File "/usr/local/lib/python3.8/dist-packages/pentestgpt/utils/APIs/chatgpt_api.py", line 81, in _chat_completion response = openai.ChatCompletion.create( File "/usr/local/lib/python3.8/dist-packages/openai/api_resources/chat_completion.py", line 25, in create return super().create(*args, **kwargs) File "/usr/local/lib/python3.8/dist-packages/openai/api_resources/abstract/engine_apiresource.py", line 153, in create response, , api_key = requestor.request( File "/usr/local/lib/python3.8/dist-packages/openai/api_requestor.py", line 298, in request resp, got_stream = self._interpret_response(result, stream) File "/usr/local/lib/python3.8/dist-packages/openai/api_requestor.py", line 700, in _interpret_response self._interpret_response_line( File "/usr/local/lib/python3.8/dist-packages/openai/api_requestor.py", line 765, in _interpret_response_line raise self.handle_error_response( openai.error.InvalidRequestError: The model gpt-4 does not exist or you do not have access to it. Learn more: https://help.openai.com/en/articles/7102672-how-can-i-access-gpt-4.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/bin/pentestgpt-connection", line 8, in sys.exit(main()) File "/usr/local/lib/python3.8/dist-packages/pentestgpt/test_connection.py", line 47, in main result, conversation_id = chatgpt.send_new_message("Hi how are you?") File "/usr/local/lib/python3.8/dist-packages/pentestgpt/utils/llm_api.py", line 225, in send_new_message response = self._chat_completion(history) File "/usr/local/lib/python3.8/dist-packages/pentestgpt/utils/APIs/chatgpt_api.py", line 119, in _chat_completion response = openai.ChatCompletion.create( File "/usr/local/lib/python3.8/dist-packages/openai/api_resources/chat_completion.py", line 25, in create return super().create(*args, **kwargs) File "/usr/local/lib/python3.8/dist-packages/openai/api_resources/abstract/engine_apiresource.py", line 153, in create response, , api_key = requestor.request( File "/usr/local/lib/python3.8/dist-packages/openai/api_requestor.py", line 298, in request resp, got_stream = self._interpret_response(result, stream) File "/usr/local/lib/python3.8/dist-packages/openai/api_requestor.py", line 700, in _interpret_response self._interpret_response_line( File "/usr/local/lib/python3.8/dist-packages/openai/api_requestor.py", line 765, in _interpret_response_line raise self.handle_error_response( openai.error.InvalidRequestError: The model gpt-4 does not exist or you do not have access to it. Learn more: https://help.openai.com/en/articles/7102672-how-can-i-access-gpt-4.

DailyPS commented 7 months ago

Did you ever made any payment for API? Error message you uploaded also occurs when you didn't make any payment.

TofuWand commented 7 months ago

Did you ever made any payment for API? Error message you uploaded also occurs when you didn't make any payment.

I've had the same issue. I've never paid for an API either, but I've paid a month of ChatGPT4 before (not the same). Usually, these ChatGPT local downloads don't require to have any API payment history, that I'm aware of at least. Hopefully, they can fix this. I was excited to use this, but I'll just not after needing to pay for some API.

GreyDGL commented 7 months ago

You have to link a payment method to OpenAI in order to use the API now.

TofuWand commented 4 months ago

You have to link a payment method to OpenAI in order to use the API now.

Thanks. 🤝 Yeah, I've heard of other tools having that issue with ChatGPT. Shalom.