How to Get a Gemini API Key

C
Collab365 TeamEditorialPublished May 18, 2026
3

At a Glance

Target Audience
Developers and app builders integrating AI models into applications
Problem Solved
Obtaining and securely managing a valid Gemini API key for AI integration
Use Case
Connecting a custom app or service to Google's Gemini AI models via API

Use this guide if an app asks you for a Gemini API key or Google AI API key.

Gemini API keys are created in Google AI Studio.

What You Need

  • A Google account.
  • Access to Google AI Studio.
  • A Google Cloud project, if Google asks you to choose or create one.

Step by Step

  1. Go to aistudio.google.com.
  2. Sign in with your Google account.
  3. Accept the terms if Google AI Studio asks you to.
  4. Open the API keys page: aistudio.google.com/api-keys.
  5. Choose the option to create an API key.
  6. If Google asks you to choose a project, select an existing project or create a new one.
  7. Create the key.
  8. Copy the key immediately.
  9. Paste it into the app or service that asked for your Gemini key.
  10. Save your changes in that app.

If You Cannot Create a Key

Check these common issues:

  • You may need to accept the Google AI Studio terms first.
  • You may need to create or choose a Google Cloud project.
  • You may not have permission to create keys in the selected project.
  • Your Google account may be managed by a school, company, or organization that blocks key creation.

If you see a message saying you do not have permission, try creating a new personal project or ask the project admin for access.

Important Safety Notes

Google warns that unrestricted API keys can be risky. If Google AI Studio shows a warning or asks you to restrict the key to the Gemini API, follow the prompt.

Do not publish your key online. If you think it was exposed, delete it and create a new one.

Official Source

Google says Gemini API keys are created and managed from the Google AI Studio API Keys page. Google also notes that keys are connected to Google Cloud projects.

Source: Google Gemini API key docs