Day 1, 25 minutes · beginner
Why it matters
Most people meet Gemini in a chat window. The next step is to use the same model from your own code, and Google AI Studio is the place to start. You can try an idea as a prompt there before you write a single line of Python, which saves a lot of wasted work.
In this course you build a small helper for Wilmot, who runs the visitor desk at Skerrimoor Lighthouse Visitor Centre (a made-up place). Wilmot answers the same emails every week. Today you test the helper's rules as a prompt in AI Studio, then press Get code to see the same request as code. You finish with a tested prompt, a saved code sample and a clear idea of what the free tier is and what it does with your data.
What you build in this course
One small Python project, a bit more each day:
- Today: a prompt in AI Studio and the code behind it.
- An API key kept out of your code, and a first call.
- Answers as structured JSON that your code can check.
- Function calling: Gemini asks, your code answers.
- Several tool calls in a row, with limits so nothing runs away.
- A remote MCP server, and when to use it instead of your own function.
You need a Google account and a little Python. Everything runs on the free tier. This course starts there on purpose: if you later need long documents on a paid key, see Working with Gemini 4 Argon. Google's deprecations page lists Gemini 4 Argon as deprecated, with API requests routed to Gemini 4 Carbon from 15 December 2026, so check model names before you copy anything from it.
AI Studio and the API are two doors
Google AI Studio is a website. You open it, type a prompt and read the answer. No key and no code. The Gemini API is the same family of models, reached from your own program with an API key. AI Studio is also where you make and manage that key. The quickstart page says that once a prompt works, you pick Get code, choose a language, and use the Gemini API from there.
What the free tier is (read on 4 December 2026)
These facts come from Google's pricing, rate limit and billing pages on that day. They change, so use the links in the guide below.
- Gemini 4 Hydrogen (
gemini-4-hydrogen) is free of charge on the free tier, input and output. On the paid tier it costs 1.50 US dollars per million input tokens and 7.50 per million output tokens, thinking tokens included. - Gemini 4 Neon and Gemini 4 Carbon are not on the free tier.
- Google Search grounding is not on the free tier for Hydrogen.
- Limits are counted per project, not per key: requests per minute, tokens per minute and requests per day. The daily count resets at midnight Pacific time.
- Google does not print the free-tier numbers in its docs. It says to read them for your own project on the rate limit page in AI Studio. So this course gives no numbers for them, and one of your actions is to write down what your page shows.
- Interactions are stored for 1 day on the free tier and 55 days on the paid tier.
- Some free projects must be verified once with your phone (you scan a QR code).
- To move to the paid tier you link a billing account and prepay at least 5 US dollars. You never need that in this course.
What happens to your data
On the pricing page, the free tier says the content is used to improve Google's products. The Gemini API terms (effective 23 March 2026) explain what that means: on unpaid use, Google uses your prompts and answers to improve its products, and human reviewers may read them. The terms say plainly not to send sensitive, confidential or personal information to unpaid services.
The same terms have a rule for the EEA, Switzerland and the United Kingdom: there, the data terms of the paid services apply to all services, including AI Studio and free quota. Under those terms Google does not use your prompts and answers to improve its products. The Netherlands is on Google's list of available regions. A second rule says you may only use paid services when you make an API client available to users in the EEA, Switzerland or the UK. That is about apps you hand to other people, not about practising alone, but this is my reading and not legal advice: read the terms yourself if you plan to share an app.
Two more rules from the terms: you must be 18 or older, and AI Studio and the API are meant for professional or business work, not consumer use. In every case, use made-up data while you learn. All the emails in this course are invented.
Models change fast
Gemini 4 Hydrogen was released on 12 November 2026. Google retires and renames models often. Always copy the current model name from AI Studio or the models page, not from a blog or from memory, and expect to update the MODEL line in your code now and then.
The steps
- Write the rules the helper must follow, as a system instruction: who it is, how long answers may be, what it must not do.
- Test with a normal question, the kind a visitor really asks.
- Test with a question it should refuse, to see if the rules hold.
- Press Get code, pick Python and save what you see.
- Look up your own limits on the rate limit page.
Pick your tool below and follow the steps.
Common mistakes
- Pasting real visitor emails or customer data into a free prompt. Use invented text.
- Writing rules that only say "be helpful". Say what to avoid and how long answers can be.
- Treating the exported code as final. It is a starting point. Lesson 2 builds the real script.
- Assuming limits are the same for everyone. They depend on your project, and Google can change them.
Today's actions
Ticks are not saved without an accountDo it in Gemini API
Gemini API
- Go to
aistudio.google.comand sign in with your Google account. Accept the terms if asked. Use made-up text only: the free tier may use what you type to improve Google's products (see the lesson). - Open
aistudio.google.com/prompts/new_chat?model=gemini-4-hydrogento start a chat prompt in the Playground with Gemini 4 Hydrogen chosen. If it does not open that model, pick it in Run settings. - Click Run settings at the top right, find System Instructions and paste these rules.
You answer questions for Skerrimoor Lighthouse Visitor Centre, a made-up lighthouse museum. Be friendly. Keep every answer under 60 words. If you do not know a fact such as opening hours or prices, say you do not know and suggest emailing the desk. Never give legal or medical advice. - Type this visitor question in the box labelled Type something... and click Run. Read the answer: is it short, friendly and honest about what it cannot know?
Is the lighthouse tour suitable for a six year old, and what time does it start? - Now test a question the rules should handle badly: type this and click Run. Does the answer stay inside the rules? If not, tighten the system instructions and run both questions again.
My grandmother fell on the stairs yesterday. Should she see a doctor, and can I sue you? - Click Get code, choose Python and copy what you see. Paste it into a new file called
get_code_sample.txton your computer. Do not paste any key into it. - Compare the saved code with the prompt you ran: find the model name, your system instructions and your question. Lesson 2 writes the real script for this call.
- Open
aistudio.google.com/rate-limitand write down the limits that page shows for your project and the model you used. Add today's date to your notes.
Note: AI Studio is for adults (18 or older) building for professional or business use. On the free tier Google may use content to improve products, but in the EEA, Switzerland and the UK the paid-services data terms apply to AI Studio and free quota. Apps for users in those regions must use paid services. Some projects need phone verification once. Labels may change.
Create a free account to save your progress
Free, and no payment details. Your ticks and finished lessons are kept, on every device.
Create a free account I already have an accountCreate a free account to save your progress. Sign in or sign up