AI

How to Get a Google AI Studio API Key: Step by Step

Step by step: sign in to Google AI Studio, create an API key for the Gemini API, store it safely and what to do if it leaks.

An API key lets your app or script call Gemini models. You create it in Google AI Studio. Google changes the interface from time to time, so button names may differ slightly.

What you need

Step by step

  1. Open aistudio.google.com and sign in with your Google account.
  2. Accept the terms of use if prompted.
  3. Find the “Get API key” button in the left menu.
  4. Create a key: pick an existing Google Cloud project or create a new one — the service offers this itself.
  5. Copy the key and save it right away somewhere safe, such as a password manager.

How to store the key safely

What to do if the key leaks

Delete it immediately on the keys page in AI Studio and create a new one. Check the project’s usage; if you see requests you did not make, change your Google account password. Use the KiwiLab Password Generator for a strong one.

Free or paid

AI Studio has a free tier: it limits requests and available models, so treat it as a way to test an idea. The paid tier is billed by usage (mostly tokens). According to published descriptions, data submitted on the free tier may be used to improve models while the paid tier does not, so avoid sending sensitive information. Always check current terms in the service itself. For a general overview, see our Google AI Studio overview.

Common problems

FAQ

Does an API key cost money?

Creating a key is free. The free tier has request limits; heavier usage is billed by usage.

Can I publish an API key on GitHub?

No. Anyone who finds it can use your quota or billing. Keep the key in an environment variable.

What is AI Studio and how is it different from Gemini?

Gemini is a ready-made chat for everyone; AI Studio is a developer environment: model settings, prototypes and API keys.

KiwiLab content is for informational purposes. Verify important details and current terms on the official websites. KiwiLab is not affiliated with the services mentioned.

← Browse all articles