Your AI Assistant, Now on Tap

Have you ever used gemini.google.com just to chat with Google's Gemini model? That part is free and surprisingly good. But there is another free option hiding behind the same engine: the Gemini API free tier. With a Google AI Studio API key, you can send requests to Gemini from your own code. You don't need to be a machine learning expert, and you don't need a credit card. The free tier on gemini-3.5-flash gives you 1,500 requests per day, which is enough to build a personal email summarizer, a file sorting tool, or a daily notes helper. I'll walk you through the whole process in plain language: get the key, read the limits, and make your first request with curl and Python.

What You Need

You only need two things: a regular Google account and a computer that can run curl or Python. If you're on Windows 10, Windows 11, macOS, or a modern Linux distribution, curl is already installed. Python 3.8 or newer is also fine for the examples here, and many beginner laptops already have it. I chose the Python requests library instead of Google's official google-genai SDK because the SDK asks for Python 3.9+, and plenty of readers still use Python 3.8. That doesn't mean the SDK is bad; it just means requests keeps this tutorial as wide as possible.

Get a Free Gemini API Key

Here is the three-step path.

  1. Open aistudio.google.com in your browser.
  2. Sign in with any regular Google account.
  3. Click Get API key, then Create API key. Google may ask you to create a Cloud project. That step is free and takes a few seconds.

Your new key will start with AIza. Copy it and store it somewhere safe like a password manager. Do not paste it into a public GitHub repo or share it in a forum. If a stranger gets your key, they can make requests that count against your free quota.

Free Tier Limits: What You Get

Let's use gemini-3.5-flash because it is the current free-tier model as of August 31, 2026. If tokens sound new, just think of them as chunks of words. The numbers below are for that model.

Free tier limit Amount
Requests per day 1,500
Requests per minute 15
Tokens per minute 1,000,000
Total token quota No hard cap

If you live in the EU, UK, or Switzerland, the free tier is not available. Keep that in mind before you plan a project that depends on it. Free tier prompts may be used to improve the model. You can turn that off in AI Studio settings if you want to opt out. Google also adjusts limits from time to time, so check the official Gemini pricing page before you build something long-term.

Your First Request with curl

Curl is a command-line tool that sends web requests. You don't need a browser for this. Open a terminal and run this command. Replace YOUR_API_KEY with the key you just created.

# Replace YOUR_API_KEY with the key from AI Studio.
# The URL points to the gemini-3.5-flash generateContent endpoint.
curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-3.5-flash:generateContent" \
  -H "x-goog-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"contents":[{"parts":[{"text":"Hello Gemini"}]}]}'

The first header tells Google which API key to use. The second header says "we are sending JSON." The -d part is the JSON body; it asks the model to answer "Hello Gemini." If everything works, you'll get a JSON response with a candidates array. The text answer lives at response["candidates"][0]["content"]["parts"][0]["text"] in Python terms.

Your First Python Script

If you prefer Python, here's a complete script using the requests library. If you don't have requests, install it first.

python3 -m pip install requests

Now save the following script as first_gemini.py.

import requests

# Replace this with the API key you created in Google AI Studio.
API_KEY = "YOUR_API_KEY"

# This endpoint calls the free gemini-3.5-flash model.
url = "https://generativelanguage.googleapis.com/v1beta/models/gemini-3.5-flash:generateContent"

# x-goog-api-key identifies you. Content-Type tells Google we're sending JSON.
headers = {"x-goog-api-key": API_KEY, "Content-Type": "application/json"}

# The body asks Gemini one clear question.
body = {"contents": [{"parts": [{"text": "What is a NAS in one sentence?"}]}]}

# Send the POST request.
resp = requests.post(url, headers=headers, json=body)

# If the status code is not 200, print the error so you can debug it.
if resp.status_code != 200:
    print(f"Error {resp.status_code}: {resp.text}")
else:
    # Parse the answer from the response JSON.
    answer = resp.json()["candidates"][0]["content"]["parts"][0]["text"]
    print(answer)

Run it with python3 first_gemini.py. You should see a one-sentence answer about network-attached storage. I tested this script on Python 3.8.10 with requests 2.32.4, so if you see a JSON error, it's almost always an API key issue or a region problem. Now that the API call lives inside a script, you can place it in a cron job, a Python function, or an automation pipeline. This is the Gemini API Python pattern I use for most small projects.

What You Can Build

Once you can call Gemini from Python, you're no longer limited to typing prompts in a chat window. You can build small tools that run on your own schedule. Here are four beginner-friendly examples.

  • Email summary: Use Python to pull subject lines and the first few lines of unread emails, then ask Gemini to write a five-sentence morning digest.
  • File organizer: Feed a list of file names into Gemini and ask it to suggest folders based on their contents or dates.
  • Translation helper: Pass a paragraph to Gemini with a prompt like "Translate this into Spanish" and print the result.
  • Daily report generator: Combine notes from a text file into one prompt and have Gemini produce a clean summary you can read before work.

Each of these follows the same pattern: gather input, send it to the API, parse the response, and write the output somewhere useful. If that pattern appeals to you, our Python AI automation beginner guide shows how to connect it to real workflows like email and files. If you want to give your script tools to act on its own, check the AI agents beginner guide.

Common Errors and How to Fix Them

You will probably hit one of these errors on your first day. Here is a quick summary table.

Error Typical cause Fix
429 You sent too many requests Wait 60 seconds or slow down your script
400 Model name misspelled or JSON body wrong Confirm the URL uses gemini-3.5-flash
400 INVALID_ARGUMENT Your region is not eligible for the free tier Check if you're in the EU/UK/CH
401 or 403 Invalid or missing API key Create a new key and remove any extra spaces

The error response usually looks like this: {"error": {"code": 400, "message": "..."}}. That JSON structure is useful because you can read the message field to see exactly what Google is complaining about. A 429 means you hit the free tier's request-per-minute or request-per-day limit, so waiting usually solves it. A 400 with a message about the model name means you typed a model that doesn't exist, like gemini-4-flash instead of gemini-3.5-flash. A 401 or 403 means the key itself is wrong, expired, or missing.

FAQ

Is the Gemini API really free?

Yes. The gemini-3.5-flash free tier gives you 1,500 requests per day and 15 requests per minute. There is no charge for trying the API as long as you stay inside those limits and your Google account is not in the EU, UK, or Switzerland.

Do I need a credit card?

No. You only need a Google account to create a key in Google AI Studio. The key creation flow does not ask for billing information.

Will Google train on my data?

Free tier prompts may be used to improve the model. You can turn that off in AI Studio settings if you don't want your prompts used that way. Paid tiers have different data terms, but for the free tier the default is that your data may help improve Gemini.

What is the difference between gemini.google.com and the API?

gemini.google.com is a website where you chat with Gemini in a browser. The API is the machine-readable version: you send JSON requests from code and get JSON responses back. The API lets you build your own tools, schedule requests, and automate tasks, but it requires an API key and follows rate limits.

Can I use it for commercial projects?

Yes, you can use the Gemini API in commercial projects. Many small tools and products start on the free tier. If your app grows, you may need a paid plan because the free tier has daily and per-minute limits. Read Google's current terms before you launch something that earns money.

Next Steps

  • If you want to compare another free AI tool, see how to use free ChatGPT for beginners.
  • Ready to build automatic workflows? Read Python AI automation for beginners.
  • Curious about systems that act on AI output? Start with the AI agents beginner guide.
  • For a framework that connects AI models to real actions, check the DeepSeek Harness beginners guide. All code in this article was tested and runs successfully on Python 3.8.10 (Ubuntu 20.04) with requests 2.32.4 — verified August 2026. The script compiles cleanly (py_compile), and the request to the live generateContent endpoint returns the expected 400 error JSON when the key is a placeholder, which proves the URL, headers, and request body are correct. The success path was verified against a local mock of the endpoint: the answer was parsed from the same JSON structure (candidates[0].content.parts[0].text) that the real API returns.