CodeLab
CodeLab guide

Get a free Gemini API key

CodeLab explains your code with your own AI key. Here is how to get one from Google for free and connect it in Visual Studio.

Install CodeLab Free on the Visual Studio Marketplace
About 2 minutesFree, no credit cardJust a Google account
Step 1

Open Google AI Studio

Go to aistudio.google.com and sign in with your Google account if it asks. Then click the key icon at the bottom left.

Shortcut: open aistudio.google.com/apikey directly. The first time, Google may ask you to accept its terms.

Google AI Studio home page, with the key icon at the bottom left of the sidebar
Step 2

Click Create API key

You are now on the API Keys page. The button is at the top right.

API Keys page with the Create API key button at the top right
Step 3

Keep the defaults and click Create key

The name and project are already filled in. You don't need to change anything.

The Create a new key dialog with the Create key button
Step 4

Click Copy key

Your key is now on the clipboard.

API key details with the key hidden and the Copy key button
Treat the key like a password. Don't post it online or share it. If it leaks, delete it on the same page and create a new one.
Step 5

Paste it into CodeLab

In Visual Studio open View › Other Windows › CodeLab, then the settings icon. Make sure Gemini is selected, paste the key and click Save.

CodeLab tests the key right away and shows Key works. The key is stored in Windows Credential Manager on your PC only.

The free tier has a daily limit. If CodeLab ever shows error 429, wait a little or switch to a lighter model in settings. On the free tier, Google may use prompts to improve its products.
Dr. Omar Aburub

You're ready.

Save a file in Visual Studio and watch your first lesson appear.

Don't have CodeLab yet? Install it from the Marketplace.

Made with care by Dr. Omar Aburub.