gencay / vscode-chatgpt

An unofficial Visual Studio Code - OpenAI ChatGPT integration
ISC License
3.5k stars 755 forks source link

Can't access ChatGPT Plus. #151

Closed ManuCanedo closed 1 year ago

ManuCanedo commented 1 year ago

Hi!

I am subscribed to ChatGPT Plus, and whenever regular ChatGPT is out of capacity, I can not log in. I am prompted with the following screen:

image

Is it planned to add support to ChatGPT Plus?

boydDuffie commented 1 year ago

Disclaimer: I'm just some guy, I don't have all of the answers so take whatever I say with a grain of salt.

That being said, I've been running into something similar. ChatGPT Plus support does already exist for this extension, but it seems to be in a semi-broken state. There was—and still may be, more on that below—a workaround, but it's definitely not ideal.

The Workaround

You can probably use a proxy server for this, but I personally haven't figured that out yet and it seems to have its own issues as well. Here's what worked for me, at least up until today.

  1. Using the extension UI, open the extension's settings (or search @ext:gencay.vscode-chatgpt chatgpt. in the settings' search bar)
  2. For the method, select Browser Auto-Login
  3. For authentication, choose the one you use to login to ChatGPT when accessing via a browser (in my case this is Google Auth)
  4. Optionally to save yourself time, add your authentication credentials in the corresponding fields

You'll know it worked if the login page opens to a different one than your provided screenshot. If you gave your login credentials to the extension in settings, you'll see that info being entered automatically.

Still Not Working?

Plan B - Reload

This should be everything you need, but I've found that when a session expires I have to disable, reload VSCode, and re-enable the extension (sometimes more than once). Given how finicky this part is, the steps mentioned above may not work at all.

A Note on Scripts

It seems like the auto-auth step for ChatGPT Plus users runs a script to log you in. Basically this means it will take the info provided in the settings earlier, and quickly—but manually—enter that info to the ChatGPT authorization webpage. Since this process is manual and doesn't use an OpenAI API, when OpenAI updates their website the script is rendered obsolete and needs to be rewritten.

TLDR:

Give The Workaround above a shot, but don't get your hopes up. The login process is probably temporarily broken for ChatGPT Plus users until one of the following happens:

  1. The extension uses an official OpenAI API for authorization (which isn't available yet)
  2. The extension uses an unofficial API for authorization (not verifiably robust)
  3. The extension uses a script with a way to navigate OpenAI's magic link authentication pattern (might be tough)

In the meantime, you can always cancel your ChatGPT Plus subscription, get a secret key from OpenAI, and give that to the extension. That side of things does use an official OpenAI API which should make the process much smoother—albeit less consistent, price-wise.

Trahloc commented 1 year ago

I have ChatGPT Plus and to get around this I follow these steps:

I enter my email address and request the personalized link. I copy the link from the email and paste it into the VSCode ChatGPT window. (Note: Do not click the link directly from the email.) I can reuse the same link multiple times on the same day. I am not sure if this works for different days.

Hope that helped.

gencay commented 1 year ago

What @Trahloc suggests is correct. If you receive a magic link to login, you need to open that link on the same tab in the window extension is opening. Otherwise, there is no way for the extension to hook into the browser's network for sending/receiving api calls.

gencay commented 1 year ago

Updated the Readme with the information, the Magic Links should be opened on the same tab that the extension is opening: https://github.com/gencay/vscode-chatgpt#browser-setup