Skip to content

How to Get a Gemini 3.8 API Key for Free

Updated 25 October 2026.

In short: Google gives anyone with a Google account free access to several Gemini models, including Gemini 3.8 Flash, through the Gemini API - no credit card. You make a free API key in Google AI Studio, then send requests from a command window, a few lines of Python, or any app built for OpenAI's API. The free tier has daily limits per model, which you can see in AI Studio at any time.

What you need

  • A Google account (the same one you use for Gmail or YouTube).
  • A computer. Windows, Mac or Linux all work.
  • Nothing to pay: the free tier needs an active project in AI Studio, not a billing account.

One thing to know before you start: on the free tier, Google uses your prompts to improve its products. Do not send private or confidential information.

Step 1: Try the models without any code

Open Google AI Studio and sign in. The Playground opens: type a question at the bottom and press Run. The panel on the right shows which model you are using (here, Gemini 3.8 Flash) and its settings.

The AI Studio Playground with the model card highlighted

This is the quickest way to see what each model can do before you write anything.

Step 2: Create your free API key

An API key is a password that lets a program use your free quota. In AI Studio, open API Keys in the left menu, then click Create API key (box 1) and follow the dialog.

The API Keys page with the Create API key button highlighted

Copy the key and keep it private:

  • Anyone who has your key can use your quota.
  • Never paste it into a website, a public code repository or a screenshot.
  • If it leaks, delete it on this page and create a new one.

Step 3: Check your free limits

Open Rate Limit in the left menu. The table shows, for each model, how much you have used and your limit: requests per minute (RPM), tokens per minute (TPM) and requests per day (RPD).

The Rate Limit page with the requests-per-day column highlighted

The free limits in October 2026 (limits can differ by project, so check your own page):

ModelRequests per minuteRequests per day
Gemini 3.8 Flash520
Gemini 3.5 Flash-Lite15500
Gemini 3.1 Flash-Lite15500
Gemma 4 31B3014,400
Gemma 4 26B3014,400

Two rules from Google's rate-limits page: limits apply per project, not per API key, so a second key does not give you more; and the daily count resets at midnight Pacific time.

Step 4: Send your first request (no programming)

Open a command window. On Windows, press the Start key, type PowerShell and open it. On a Mac, open Terminal.

Windows (PowerShell) - paste these two lines, putting your key in place of YOUR_API_KEY:

$env:GEMINI_API_KEY = "YOUR_API_KEY"
$r = Invoke-RestMethod -Method Post -Uri "https://generativelanguage.googleapis.com/v1beta/interactions" -Headers @{ "x-goog-api-key" = $env:GEMINI_API_KEY } -ContentType "application/json" -Body '{"model":"gemini-3.8-flash","input":"Explain how AI works in a few words"}'

Then show the answer:

($r.steps | Where-Object type -eq 'model_output').content.text

Mac or Linux (Terminal) - this is Google's own example:

export GEMINI_API_KEY="YOUR_API_KEY"
curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions" \
  -H "x-goog-api-key: $GEMINI_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "gemini-3.8-flash",
    "input": "Explain how AI works in a few words"
  }'

You get a short answer back. That is one request from your free daily quota.

Step 5: Use it from Python

Back in the Playground, click Get code. AI Studio writes the code for whatever you set up, and it reads your key from GEMINI_API_KEY (box 3) - so the key never sits in the code.

The Get code window with the line that reads the API key highlighted

The minimum version, from Google's quickstart:

pip install -U google-genai
from google import genai

client = genai.Client()  # reads GEMINI_API_KEY

interaction = client.interactions.create(
    model="gemini-3.8-flash",
    input="Explain how AI works in a few words"
)
print(interaction.output_text)

Step 6: Use it in an app made for OpenAI

Many chat apps and tools ask for an OpenAI API key. Gemini works there by changing three settings (Google's OpenAI compatibility page):

Setting the app asks forWhat to enter
API keyyour Gemini API key
Base URL (sometimes called API endpoint)https://generativelanguage.googleapis.com/v1beta/openai/
Modelgemini-3.8-flash (or another model with a free tier)

When something goes wrong

What you seeWhat it meansWhat to do
429 or RESOURCE_EXHAUSTEDYou used up a limitWait a minute (per-minute limit) or until midnight Pacific (daily limit), or switch to a model with a higher limit such as Flash-Lite or Gemma 4
403 or API key not validThe key is wrong or deletedCopy it again from the API Keys page
A model is not available on the free tierThat model is paid-onlyGemini 4 Argon and 3.1 Pro have no free tier; pick a Flash, Flash-Lite or Gemma model

Words to know

  • API: a way for one program to ask another for something - here, your program asks Gemini a question.
  • API key: the password that identifies you to the API and counts your usage. See what is an API key.
  • Free tier: the free quota Google gives each project.
  • RPM / TPM / RPD: requests per minute, tokens per minute, requests per day - the three limits.
  • Token: a piece of a word; the unit models read and write. See tokens and context windows.
  • Base URL: the address an app sends its requests to.

More free AI API keys

Gemini is one of the providers with a free tier. How to get AI API keys for free lists each one with its daily limit and source.

Frequently asked questions

Is the Gemini API free?+

Yes, for the models Google lists as free of charge on its pricing page, within daily limits. Gemini 4 Argon and Gemini 3.1 Pro are paid-only.

Can I get a Gemini 3.8 API key for free?+

Yes. A free API key from Google AI Studio works with Gemini 3.8 Flash on the free tier. In October 2026 the free limit is 5 requests a minute and 20 a day.

Do I need a credit card for the Gemini API free tier?+

No. The free tier needs an active project in AI Studio, not a billing account.

What are the Gemini API free tier limits?+

They are per model and per project, shown on AI Studio's Rate Limit page. In October 2026 they are 20 requests a day for Gemini 3.8 Flash, 500 for Flash-Lite and 14,400 for Gemma 4.

Does Google use my prompts on the free tier?+

Yes. On the free tier Google uses your prompts to improve its products; on the paid tier it does not.

Can I make more API keys to get more free requests?+

No. Limits apply per project, not per API key.

More free API key tutorials

Want to use these APIs in a desktop app? OpenCode is a free, open-source AI coding app for Windows, Mac and Linux. How to add free API keys to OpenCode and pick a model.