-
Notifications
You must be signed in to change notification settings - Fork 749
connect ETIMEDOUT when using API key integration #176
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
Comments
@yibuxulong thank you for using the extension. Could you try resetting your session 2nd troubleshooting: Please place the same api token in the following CURL command (replace curl https://api.openai.com/v1/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-d '{
"model": "text-davinci-003",
"prompt": "Can I make a request?\n\n",
"temperature": 0.7,
"max_tokens": 256,
"top_p": 1,
"frequency_penalty": 0,
"presence_penalty": 0
}' |
thanks for your replying! @gencay |
@gencay @yibuxulong How to solve it |
@laterdayi Switching system proxy with VPN worked for me. |
hello, i get a ok, i deal with it... if someone has the same problem, then go on: as we know, if you are in china mainland or somewhere, the openai api could be visited some days before, and i used this extension well. but recently the api is blocked by GFW, if use it directly will return somthing like at first i just switched on my clash, but that didn't work, then i uninstall this extension and reinstall, delete the api-key, turn off and on my vpn, close and open vscode, and fill the api-key in a session, and it can output somehow... i have to admit i don't know why it can't or can work before and after... |
if you have a proxy serve, you can set genieai.openai.apiBaseUrl: http://xxx in setting.json. |
I enjoyed vscode-chatgpt for a week, but since March. 1st, I met a connection problem once I ask questions, there return:
request to https://api.openai.com/v1/chat/completions failed, reason: connect ETIMEDOUT 199.59.149.205:443
and in the https://api.openai.com/v1/chat/completions, I found:
{ "error": { "message": "You didn't provide an API key. You need to provide your API key in an Authorization header using Bearer auth (i.e. Authorization: Bearer YOUR_KEY), or as the password field (with blank username) if you're accessing the API from your browser and are prompted for a username and password. You can obtain an API key from https://platform.openai.com/account/api-keys.", "type": "invalid_request_error", "param": null, "code": null } }
but I had provided an API key:

I have tried to uninstall vscode-chatgpt and re-install it many times, and applied new API codes, reopen the vscode, but none of them helped.
Could anybody give me some advice?
The text was updated successfully, but these errors were encountered: