Code Snippets AI - Turn Your Questions Into Code with GPT-4!
Automatically generate code from scratch, ask questions, get explanations, refactor code, find bugs and more!
This Visual Studio Code extension allows you to use GPT-4 (on the Pro Plan) or ChatGPT to generate code or natural language responses to your questions.
Save your code snippets to your online library for your whole team to use!
The Chat features of this extension were built on top of Ali Gençay's ChatGPT Extension and all credits go to him for the chat functionality.
Built with GPT-4 & ChatGPT
We use GPT-4 & ChatGPT, which provides faster and more accurate responses to your questions, compared to GPT-3 or Codex.

Features
- Ask general questions or use code snippets from the editor to query the AI
- Insert custom prompts from anywhere with keybinding: (Ctrl + Shift + A)
- Right click on selected code to perform one of the following commands
- Add tests
- Find Bugs
- Optimize
- Explain
- Add comments
- Refactor code
- Save Code Snippets
- View AI responses in the sleek side panel
- See the responses as they are being generated
- Ask follow-up questions to the response (conversation context is maintained)
- Save and fetch your code snippets from your online library
Installation
To use this extension, install it from the VSCode marketplace.
Why not use an OpenAI API key?
After asking the development community, we have found a few key points that influenced our decision to introduce a pricing model:
- ChatGPT Plus is expensive at $24/month.
- Using GPT-4 can lead to more expensive monthly cost for users, over $30/month!
- CodeSnippets.ai is only $10/month and uses the same GPT-4 API on our PRO plan, or ChatGPT with other Plans.
- You can also save your code snippets into your online library for your whole team to access!
- Fetch your code snippets from your online library
- Collaborate with your team
Get your API key
To use this extension, you will need an API key from your dashboard.
To get one, follow these steps:
- Go to codesnippets.ai
- If you don't have an account, you will need to create one or sign up.
- Sign up to the free trial.
- Copy the API key from the dashboard and paste it into the Access Token field in the extension settings.
- After completing these steps, the extension should be ready to use.
Usage
- Open a file in Visual Studio Code and click on the CodeSnippets icon in the sidebar.
- This will open the side panel with an input field.
- Enter your prompt or question.
- Click Enter.
- The prompt will be sent to the AI.
- The response will be displayed below the input field in the sidebar.
Add context to your request with selected code
Select some code in the editor, right click on it and choose one of the following commands from the context menu:
- AI -> Ask anything : Opens the custom command window for you to insert your own prompt. (You can also press Ctrl + Shift + A). With or without selected code for added prompt context.
- AI -> Add tests : Creates tests for the selected code.
- AI -> Find bugs : Looks for problems/errors in the selected code, fixes and explains them.
- AI -> Optimize : Make the selected code more concise and easier to read.
- AI -> Explain : Explains what the selected code does.
- AI -> Add comments : Generate comments for the selected code.
- AI -> Refactor code: Refactors the selected code.
- AI -> Documentation : Creates detailed documentation for the selected code.
- Save Code Snippet : Saves your code snippet to your online library for your whole team to access.
Example Usage
Refactoring selected code

Generic questions

Optimizing Code

Using snippets from your online library

FAQ
Answers to our most popular questions can be found here: FAQ
GPT-4 is only available on our Pro plan.
ChatGPT is used for all other plans.
Pricing
Our pricing models can be found here: Pricing
We hope you enjoy using Code Snippets AI.
If you have any questions or wish to request a feature, please get in touch
Instagram or Twitter
Credits to Ali Gençay
We built this extension on top of another from the marketplace, unaware that the one we had built on top of had been modified and used without the proper license. Copyright and all credits for chat functionality go to Ali Gençay, Copyright (c) 2022 and his ChatGPT Extension.
As an attempt to rectify this oversight, we have removed all previous versions of this extension and ask you to stop using it and to delete it from your system.
Credit to AI Code Snippets for Code Snippets Library features & Integration with our pre-existing software.