Gemini Cookbook: Based on Google Materials · Lesson 1
First Steps with the Gemini API
Install the google-genai SDK, pick a model (3.8 Flash, 3.5 Flash-Lite or 4 Argon), make your first Interactions API call, and cover system instructions, conversations via previous_interaction_id, token counting, thinking_level and the retirement of temperature, top_p and top_k, multimodal input and handling blocked requests.
Installation and Client Initialization
pip install -U 'google-genai>=2.3.0'
The Interactions API is available in google-genai 2.3.0 and later. The latest Python SDK release is v3.0.0 (November 6, 2026). In a real project, pin the version in requirements so the next SDK update does not break your code.
from google import genai
client = genai.Client() # reads the key from GEMINI_API_KEY
MODEL_ID = "gemini-3.8-flash"
The rest of this lesson opens after a free sign-up
Sign up with email or Google: the first two lessons of every course stay open for good, and the whole catalog is open for 7 days. No card needed.


