Skip to main content
gradually.ai logogradually.ai
Blog
About Us
Subscribe to AI Newsletter
AI Newsletter
  1. Home
  2. AI Blog

Google Gemini API: How to Create (and Use) an API Key

Step by step to your Google Gemini API key: Set up account, understand limits and securely use the key in Zapier, Cursor or your own projects.

FHFinn Hillebrandt
July 23, 2024
Auf Deutsch lesen
AI Technology
Google Gemini API: How to Create (and Use) an API Key
𝕏XShare on XFacebookShare on FacebookLinkedInShare on LinkedInPinterestShare on PinterestThreadsShare on ThreadsFlipboardShare on Flipboard
Links marked with * are affiliate links. If a purchase is made through such links, we receive a commission.

The Google Gemini API is a programming interface that allows you to use Google's AI models (e.g., Gemini 1.5 Pro or Gemini 1.5 Flash) outside of ChatGPT as well.

More and more users are working with Gemini models, and the API has become an important alternative. Current benchmarks show that Gemini 1.5 Ultra can keep up even with demanding tasks.

This is necessary, for example, if you want to create your own AI software or app, or integrate AI functions into your existing software or app.

However, having a Gemini API key is now also a must for non-developers. Because there are many apps and programs that require (optionally or mandatory) an API key. These include, for example, SheetMagic, Zapier, Make, Cursor.so or various ChatGPT alternatives.

This can save you a lot of money:

By connecting external tools to the Gemini API, you can save yourself a Gemini Advanced subscription.

In the following guide, I'll show you how to create a Google Gemini API key:

TL;DRKey Takeaways
  • Create Google Gemini API key: Google AI Studio → API Keys → Create new API key → Store securely
  • Much cheaper than ChatGPT API: Gemini Flash from $0.075 per 1M tokens vs. GPT-4 at $30 per 1M tokens
  • Use API keys in Zapier, Make or Cursor for AI features without expensive subscriptions

1. Create a Google account

To use the Gemini API from Google, you absolutely need a Google account (a personal account or Workspace account).

I assume you already have one. If not, you can find instructions here.

2. Sign up for Google AI Studio

Google AI Studio Sign Up

AI Studio is Google's counterpart to the OpenAI Platform or Anthropic API Console.

With Google AI Studio, you can try out all Gemini models, create an API key, and even perform fine-tuning for certain models:

Open the website and sign in with your Google account.

3. Generate API key

To create a Gemini API key and use the Gemini API, click on the blue "Get API key" button at the top of the sidebar:

Google AI Studio Get API Key Button

Now you're in the API keys overview. Click on "Create API key" here:

Google AI Studio Create API Key

Next, you need to create an existing project in Google Cloud or a new project (every API key from Google must be linked to a project in Google Cloud).

Click on "Create API key in new project" here:

Google AI Studio Create API Key in New Project

After a bit of waiting, your API key will be displayed. Click the "Copy" button:

Google AI Studio API Key Generated
Warning
The key is only shown once! Copy it immediately and store it in a safe place. Treat it like a password and never share it.

4. What does the Google Gemini API cost?

The Google Gemini API can be used either in the free tier or with "Pay-as-you-go".

The free tier is more than enough for occasional or private use. The limits for Gemini 1.5 Flash, for example, are very generous:

Gemini 1.5 Flash Pricing

Important: The free tier is not available in Germany. If you try to activate it, an error message will be displayed (see below). However, it works if you're logged in via a VPN in the USA (e.g., via NordVPN).

Free Gemini API Key gives error

With Gemini 1.5 Pro, however, you only have two requests and 32,000 tokens per minute and 50 requests per day. This means it's not possible to make requests with more extensive documents of over 16,000 words:

Gemini 1.5 Pro Pricing

With Pay-as-you-go, you pay according to the amount of tokens you send to the Gemini models (input) and receive as a response (output). One token corresponds to approximately 4 characters, or about half a word. One million tokens therefore corresponds to 500,000 words.

For Gemini 1.5 Flash, for example, one million tokens costs $0.35 for input and $1.05 for output.

5. Set up Pay-as-you-go

If you want to use the Google Gemini API with higher limits in the "Pay-as-you-go" plan, you need to add your payment details in Google Cloud.

To do this, click on the "Set up billing" link in the API overview in Google AI Studio:

Google AI Studio Set Up Billing

You will then be redirected to the Google Cloud Console, where you need to link a billing account with your project:

Google Cloud Link Billing Account

6. Test API key

If you want to test whether your API key works, you can do this very easily with the following cURL command (e.g., in Mac Terminal):

curl \
  -H 'Content-Type: application/json' \
  -d '{"contents":[{"parts":[{"text":"Explain how AI works"}]}]}' \
  -X POST 'https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash-latest:generateContent?key=YOUR_API_KEY'

Frequently Asked Questions about the Google Gemini API

𝕏XShare on XFacebookShare on FacebookLinkedInShare on LinkedInPinterestShare on PinterestThreadsShare on ThreadsFlipboardShare on Flipboard
FH

Finn Hillebrandt

AI Expert & Blogger

Finn Hillebrandt is the founder of Gradually AI, an SEO and AI expert. He helps online entrepreneurs simplify and automate their processes and marketing with AI. Finn shares his knowledge here on the blog in 50+ articles as well as through his ChatGPT Course and the AI Business Club.

Learn more about Finn and the team, follow Finn on LinkedIn, join his Facebook group for ChatGPT, OpenAI & AI Tools or do like 17,500+ others and subscribe to his AI Newsletter with tips, news and offers about AI tools and online business. Also visit his other blog, Blogmojo, which is about WordPress, blogging and SEO.

Similar Articles

ChatGPT Versions: All 28 GPT Models at a Glance
AI Technology

ChatGPT Versions: All 28 GPT Models at a Glance

November 21, 2025
FHFinn Hillebrandt
Gemini Models: All Google Models at a Glance
AI Technology

Gemini Models: All Google Models at a Glance

November 21, 2025
FHFinn Hillebrandt
ChatGPT Statistics 2026: Fascinating Numbers, Data & Facts
AI Technology

ChatGPT Statistics 2026: Fascinating Numbers, Data & Facts

September 14, 2025
FHFinn Hillebrandt
The 9 Best AI Image Generation Models in 2026
AI Technology

The 9 Best AI Image Generation Models in 2026

June 18, 2025
FHFinn Hillebrandt
Deep Research: Grok 3 vs. ChatGPT vs. Perplexity vs. Gemini
AI Technology

Deep Research: Grok 3 vs. ChatGPT vs. Perplexity vs. Gemini

April 3, 2025
FHFinn Hillebrandt
GPT-3.5 vs. GPT-4: What's the Difference?
AI Technology

GPT-3.5 vs. GPT-4: What's the Difference?

October 1, 2024
FHFinn Hillebrandt

Stay Updated with the AI Newsletter

Get the latest AI tools, tutorials, and exclusive tips delivered to your inbox weekly

Unsubscribe anytime. About 4 to 8 emails per month. Consent includes notes on revocation, service provider, and statistics according to our Privacy Policy.

gradually.ai logogradually.ai

Germany's leading platform for AI tools and knowledge for online entrepreneurs.

AI Tools

  • AI Chat
  • ChatGPT in German
  • Text Generator
  • Prompt Enhancer
  • FLUX AI Image Generator
  • AI Art Generator
  • Midjourney Prompt Generator
  • Veo 3 Prompt Generator
  • AI Humanizer
  • AI Text Detector
  • Gemini Watermark Remover
  • All Tools →

Creative Tools

  • Blog Name Generator
  • AI Book Title Generator
  • Song Lyrics Generator
  • Artist Name Generator
  • Team Name Generator
  • AI Mindmap Generator
  • Headline Generator
  • Company Name Generator
  • AI Slogan Generator

Business Tools

  • API Cost Calculator
  • Token Counter
  • AI Ad Generator
  • AI Copy Generator
  • Essay Generator
  • Story Generator
  • AI Rewrite Generator
  • Blog Post Generator
  • Meta Description Generator
  • AI Email Generator

Resources

  • MCP Server Directory
  • Agent Skills
  • n8n Hosting Comparison
  • OpenClaw Hosting Comparison

© 2025 Gradually AI. All rights reserved.

  • Blog
  • About Us
  • Legal Notice
  • Privacy Policy