This is an extension to quickly query OpenAI's ChatGPT (both GPT-3.5 and GPT-4) from VS Code. A ChatGPT Plus subcription is not required to use this extension.
GPT-3.5, which powers ChatGPT, is a large language model made by OpenAI. The official GPT-3.5 API costs $0.002 / 1K tokens for both prompts and responses, where 1,000 tokens is approximately 750 words, so $1 would buy approximately 375,000 words.
Alternatively, you can opt to use GPT-4, GPT-3.5's successor, which is an even more powerful model. The API is currently invite-only, however you can sign up for the waitlist here. The API is more expensive than GPT-3.5, costing $0.03 / 1K tokens for prompts and $0.06 / 1K tokens for responses, meaning $1 would buy approximately 12,500 words of prompts and 6,250 words of response..
To use this extension, you must provide an OpenAI API token linked to an account with billing set up; costs for using the API are charged directly to your OpenAI account.
ChatGPT: Ask why code isn't working
.ChatGPT: Ask to explain code
.Use the "ChatGPT: Ask a question" command in the Command Palette:
Ctrl
+ Shift
+ P
to open the Command Palette.ChatGPT: Ask a question
, and select it when it appears.When you first query ChatGPT, you will be prompted to enter an OpenAI API key. This is used by the extension to access the API and is only sent to OpenAI.
To find your OpenAI API key:
You must also have billing set up on your OpenAI account (see Pricing below).
Once your OpenAI API key has been set you can update it using the "ChatGPT: Change OpenAI API key" command in the Command Palette:
Ctrl
+ Shift
+ P
to open the Command Palette.ChatGPT: Change OpenAI API key
, and select it when it appears.The GPT-3.5 API is charged by OpenAI at $0.002 / 1K tokens, while the GPT-4 API comes at $0.03 / 1K tokens. This is charged directly to your OpenAI account. To use this extension, you must set up billing on your account. Find more info about pricing at https://openai.com/pricing#chat.
In order to switch the model between GPT-3.5 (default) and GPT-4:
Ctrl
+ ,
to open Preferences.chatgpt-helper.model
.