Skip to content
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 API Key not accepted ? #254

Open
K4ZUM4KIRYU opened this issue Nov 30, 2024 · 6 comments
Open

OpenAI API Key not accepted ? #254

K4ZUM4KIRYU opened this issue Nov 30, 2024 · 6 comments

Comments

@K4ZUM4KIRYU
Copy link

API KEY ISSUE ?
Result of pentestgpt-connection after correctly exporting the API Key that I have created on https://platform.openai.com/api-keys.

Output message here :

image

Additional context
I am pretty much sure that I have correctly create an API Key and that I have access to GPT-4 and so on since I already pay for it, maybe this could be related to changes that were made by OpenAI and the PentestGPT is no longer valid ? Appreciate a help here regarding this. Key is correctly exported as mentioned in the readme.md

@GreyDGL
Copy link
Owner

GreyDGL commented Nov 30, 2024

Did you import your OpenAI API key into the system environment?

@K4ZUM4KIRYU
Copy link
Author

I don't recall seeing importation in the readme.md
Is there a particular process to do so ?
Forgot to mention that the system being used is Kali Linux, not sure if Windows system might be appropriate ?

@GreyDGL
Copy link
Owner

GreyDGL commented Nov 30, 2024

image Did you follow step 3?

@K4ZUM4KIRYU
Copy link
Author

I followed step 3 as indicated exactly :

image

Key is masked for security reasons, and whenever I pentestgpt-connection, I get the same error of unsupported version (failure to communicate) + the API Key is properly configured, although it should be OK.

Any idea what can be possibly going wrong ?
Thanks in advance.

@GreyDGL
Copy link
Owner

GreyDGL commented Dec 1, 2024

I just tried the installation process again and everything is working.
Something that you may want to debug on: (1) have you installed any other packages in this virtualenv? Any OpenAI version conflicts? (2) What is your python version? You should use python>=3.10 if possible. OpenAI library does not support python<3.10. I recommend using python3.12

@K4ZUM4KIRYU
Copy link
Author

K4ZUM4KIRYU commented Dec 4, 2024

Hi again Grey, sorry for the delay.
Here are all the answers for your questions/suggestions.

I have recreated from scratch a new Virtual Environment and no packages are install at all except the necessary that are mentioned in your README.md pip3 install git+https://github.com/GreyDGL/PentestGPT.
image

As for the second question, not sure what you mean exactly with OpenAI version here, do you mean the one that should be installed on the system environment ? if so then this the version that I currently have on my Kali Linux System. Just to precise as well when I try using tmux, I am unable to install the packages, not quite sure if there are the set of command lines that needs to be used.
image

As for the third question, I have checked the python version that I have and I indeed use the exact same version recommenced by you, python3.12.
image

Lastly, error is still the same related to incorrect API Key, although it is correct but I would like to ask for validation that they key starts with sk-XXXXXXXX-XXX-XXXXXXX and the rest of it correct ? or is there a part that needs to be skipped ?
image

I appreciate you help on this.
Will be waiting to hear from you.
Until then, thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants