1. Home
  2. Tutorials
  3. How to generate a Google Gemini API Key

How to generate a Google Gemini API Key

Intro

The Gemini API provides a Free Tier that allows you to experiment and integrate AI features without any initial cost. Before using the API, it is important to understand how rate limits work and what resources are available under the Free Tier.

Rate Limits

Rate limits determine how many requests you can send to the Gemini API within a specific period. They ensure fair usage for all developers, prevent abuse, and help maintain system performance.

You can find the official rate-limit documentation here:
https://ai.google.dev/gemini-api/docs/rate-limits#free-tier

Free Tier Availability

Under the Free Tier, you can use Text-Out models with the following limits:

  • Gemini 2.5 Pro (Text-Only): 50 requests per day (RPD)

This allocation is sufficient for testing, tutorials, and small development workflows. When your project grows and you require a higher volume of requests, you can upgrade to a paid tier for additional capacity.

Generating an API Key

Step 1:

Go to: https://aistudio.google.com/ and log in using your Google account by clicking on “Get Started”.

Step 2:

From the bottom left part of the page, click on “Get API key”.

How to get a Google Gemini API key
Step 3:

On the next page, click “Create API key.” You will then be asked to name the key and select your Google Cloud project.

If you do not already have a project, you will need to create one before continuing.

Creating the Gemini API key
Step 4:

To view your API key, click on the key name, then copy the value shown under “API Key.”

View the Gemini API key

Set up Billing for Image Generation

For image generation or image editing actions, you must use an image-capable model (for example, Gemini 2.5 Flash Image). These image-capable models are available only on paid tiers, which means you must set up billing in your Google Cloud project.

From your API Key page, click on the “Set up Billing” button

Setting up the billing for the Gemini API key


You will then be redirected to the Google Cloud Platform to complete the billing setup. In the first step, you will need to choose your account and select your country.

In the second step, you will need to enter your contact details and payment information.

NOTE: Google also offers a Free Trial program for new customers, which provides additional resources beyond the standard Free Tier. As part of this trial, new users receive 90 days of access/$300 in free credits that can be used across most Google Cloud services, including those required for using paid Gemini models. You can find more details about the Free Trial and its conditions on Google’s official page: https://docs.cloud.google.com/free/docs/free-cloud-features#free-trial
Updated on November 21, 2025

Was this article helpful?