How to Build Your First AI App with the Gemini API in Python
A beginner course in Python: build your first AI app with the Gemini API and Google AI Studio, on the free tier, with no billing set-up.
- Gemini API
- 6 days
- beginner
- 6 lessons
- about 3 hours
Free and self-paced. Every lesson is open to everyone.
Start with lesson 1What you will do
You try a prompt in AI Studio, make an API key, get structured JSON, let Gemini call your functions, cap your usage and connect a remote MCP server. The example is a made-up lighthouse visitor desk. You need a Google account and basic Python. The free tier's limits and data terms depend on your region: lesson 1 explains them.
How this course works
The course is free and you go at your own pace. Each lesson is short: a bit of reading and a few small tasks you do in the tool itself, so you learn by using it. Every lesson is open to everyone, no account needed. A free account saves your progress, so you can pick up where you left off on any device. What the account stores and how to get it removed is on the privacy page.
Syllabus
- Day 1, 25 minutes How to try a prompt in Google AI Studio and get the code Test a prompt with system instructions in Google AI Studio, press Get code, and note the free-tier limits and data rules for your project.
- Day 2, 30 minutes How to get a Gemini API key and make your first call in Python Create a Gemini API key, keep it out of your code and git, and run a Python script that sends one request to Gemini 4 Hydrogen.
- Day 3, 30 minutes How to get structured JSON output from the Gemini API Make Gemini return JSON that matches a Pydantic schema, and check five visitor emails with code instead of by eye.
- Day 4, 30 minutes How to use function calling with the Gemini API in Python Declare three tools, let Gemini ask for one, run it in your code and send the result back so Gemini writes the final answer.
- Day 5, 30 minutes How to chain tool calls and cap your Gemini API usage Handle several tool calls in one turn and in a chain, and add limits for rounds, tokens and output so one question cannot run away.
- Day 6, 25 minutes How to connect a remote MCP server to the Gemini API Connect a public MCP server to a Gemini request, read the MCP tool calls in the response and decide when MCP beats your own function.