How to Get a Free Gemini API Key for n8n

Get a free Gemini API key from Google AI Studio, add it as a Google Gemini credential in n8n and use it in the Gemini Chat Model — step by step.

The AI part of the Gmail auto-reply workflow runs on Google Gemini. To use Gemini in n8n you need a Gemini API key — and you can get one for free from Google AI Studio in a couple of minutes, no credit card needed.

In short

  • Open aistudio.google.com/apikey and sign in with your Google account.
  • Click Create API key and copy it.
  • In n8n create a Google Gemini(PaLM) Api credential: keep the default Host, paste the key, Save.
  • Pick it in the Google Gemini Chat Model node and choose a model such as Gemini 2.5 Flash.
Free Gemini API key in 3 steps: Google AI Studio → n8n
Free Gemini API key in 3 steps: Google AI Studio → n8n

Step 1: Open Google AI Studio

Go to aistudio.google.com/apikey and sign in with your Google account. The first time, accept the terms.

Step 2: Create the API key

  1. Click Create API key.
  2. Choose Create API key in new project, or pick an existing Google Cloud project (for example the one you made for Gmail).
  3. Copy the key — it starts with AIza. Keep it private; anyone with it can use your quota.

Step 3: Add the key to n8n

  1. In n8n open Overview → Credentials → Create credential and search Google Gemini(PaLM) Api.
  2. Host: leave the default:
https://generativelanguage.googleapis.com
  1. API Key: paste your key, then click Save. n8n tests the connection.
The n8n Gemini credential: default host, your API key
The n8n Gemini credential: default host, your API key

Step 4: Use it in a workflow

In an AI Agent, add a Google Gemini Chat Model sub-node, choose your new credential and pick a model. Gemini 2.5 Flash is a good default: fast, capable and available on the free tier.

Google Gemini Chat Model: your credential and Gemini 2.5 Flash
Google Gemini Chat Model: your credential and Gemini 2.5 Flash

About the free tier

  • The free tier has rate limits (requests per minute and per day). That’s plenty for learning and small workflows like an email auto-reply.
  • On the free tier Google may use your prompts to improve its products — don’t send sensitive data you wouldn’t want shared. For business data, consider a paid plan.
  • Leaked a key? Delete it in AI Studio and create a new one, then update the n8n credential.

Frequently asked questions

Is the Gemini API really free?

Yes, there is a free tier with rate limits per minute and per day — no credit card needed. Higher limits need a paid plan.

Which Gemini model should I pick in n8n?

Gemini 2.5 Flash is a good default: fast, smart enough for emails and posts, and on the free tier. Try a Pro model for harder reasoning.

What Host do I enter in the n8n credential?

Keep the default, https://generativelanguage.googleapis.com. n8n’s Gemini nodes don’t support other hosts or proxies.

Why does n8n say “Couldn’t connect with these settings”?

Usually the key was copied with extra spaces or has been deleted. Copy it again from AI Studio, or create a new key.

Can I use the same key in several workflows?

Yes. Create the credential once and select it in every Gemini node — they all share the same free-tier limits.

What’s next?

With the key ready, build the Gmail auto-reply workflow. You’ll also need a Google OAuth credential for Gmail.

Need a Website or System for Your Business?

Tell us what you need — we'll build, host and support it for you.

Book Free Consultation