Gemini API Tutorials
This folder contains guides to help you explore all Gemini API features using complete end-to-end code examples.
When you're confident in your Gemini capabilities, the examples folder will be an endless source of inspiration on how to mix those capabilities together.
Gemini 3.8 Flash: Our most intelligent Flash model, engineered for long-horizon software engineering, autonomous agents, and complex enterprise workflows. Get started with the Get Started
and the thinking
guides.
Omni Flash: The Nano Banana of video editing is here! Lean how to call the model using the interactions API, edit videos with natural language and more here
!
🍌 Nano-Banana 2 Lite: Go bananas with our latest and fastest image generation model: Nano-Banana 2 Lite. Get started here
with a ton of examples!
Agents API: Create and run your custom agents using the new Antigravity agent
!
Table of contents
If you're new to Gemini API, you should start with these two guides:
| Quickstart | Description | Open |
|---|---|---|
| Authentication | Start here to learn how you can set up your API key so you can get access to the Gemini API. | |
| Authentication with OAuth | Learn how to authenticate with the Gemini API using OAuth 2.0. | |
| Get Started | Learn how to make your first calls to the Gemini API and get a quick overview of everything it can do. | |
Then learn about how to Get Started with the other models that you can use with the API:
| Quickstart | Description | Open |
|---|---|---|
| Managed agents | Create and run agents on isolated VM from the Gemini API | |
| Lyria 3.5 | Convert your ideas into songs with full control over the music structure and more! | |
| Nano-Banana 2 & Pro aka. Gemini Image | Get to know how the Gemini model can directly output images and edit them through multi-turn discussion. Now featuring Gemini 3.8 Flash! | |
| Omni Flash | Get started with high-speed video generation and conversational editing using Gemini Omni Flash and the Interactions API. | |
| Veo | Get started with video generation using the Veo models. | |
| Veo (REST) | Get started with video generation using the Veo models (REST version). | |
| Imagen | Get started with our image generation model. | |
| Imagen (REST) | Get started with our image generation model (REST version). | |
| Deep Research | Get started with the Deep Research specialized agent for exhaustive multi-step research. | |
| Thinking models | The thinking models are, as their names imply, capable of deeper chains of thoughts than the classical models, this guide will show you how to use those thinking capabilities to solve complex problems. | |
| Thinking models (REST) | Get started with thinking capabilities using the REST API. | |
| Lyria RealTime | The Lyria RealTime model let's your generate music and prompt the model in real-time to have it mis it for you live. | |
| Text-to-speech | The TTS models let you generate speeches with one or even two speakers! | |
| Gemini Transcribe | Transcribe audio files and real-time streams with word-level timestamps, speaker diarization, custom vocabulary, and smart transcription (disfluency removal). | |
There're multiple ways to call the models using the Gemini API, these other Get Started guides will then show you the other ways to call the model:
| Quickstart | Description | Open |
|---|---|---|
| generateContent | Get started with generateContent, the core method for sending prompts to the models. | |
| Interactions API | Overview of the unified Interactions API for building with Gemini models and agents. | |
| Get started with Live API | Get started with the live API with this comprehensive overview of its capabilities | |
| Get started with Live Translation | Translate audio streams in real-time using the Live Translation API | |
| OpenAI compatibility | Did you know that you could use Gemini using the OpenAI SDK? | |
Finally, these guides will deep-dive into specific capabilities of the Gemini models and API:
| Quickstart | Description | Open |
|---|---|---|
| Grounding | Learn how to use diffrent ways (Google Search, Google Maps, Youtube, url context) to ground your answers with external sources. | |
| File Search | Upload and search your data using the hosted RAG capability of the File Search tool. | |
| Search Grounding | Deep-dive into the Google search grounding capabilities. | |
| Gemini Robotics-ER 1.5 Preview | Learn how to use the Gemini Robotics Embodied Reasoning model for spatial understanding and reasoning | |
| Batch-mode | Use Batch-mode to send large volume of non-time-sensitive requests to the model and get a 50% discount. | |
| Inference tiers | Learn how to use the different inference tiers to help you balance speed, cost, and reliability. | |
| Webhooks | Configure webhooks to receive real-time notifications when asynchronous operations like batch jobs and video generation complete. | |
| Function Calling | Discover how to have Gemini call you own function and enhaced its capabilites. | |
| Spatial understanding | Learn how to use Gemini's spatial understanding capabilities to detect what's in your images, and reason about them | |
| Video understanding | Learn how to use Gemini's video understanding capabilities to analyze what's in your videos | |
| Agentic video understanding | Combine video processing with structured tool calling and analysis. | |
| Get started with Live API tools | Now you know everything about the Live API, go to the next level and learn how to use tools with it! | |
These guides will walk you through the various use cases of the Gemini API:
| Quickstart | Description | Open |
|---|---|---|
| Asynchronous requests | Learn how to use Python's async/await API with the Gemini SDK to parallelize calls. | |
| Counting Tokens | Tokens are the basic inputs to the Gemini models. Learn how to count tokens in your text and multimodal prompts. | |
| Models | Learn about the different models and parameters available in the Gemini API. | |
| Working with files | Use the Gemini API to upload files (audio, video, images, code, text) and perform actions with them through the Gemini models. | |
| Audio | Learn how to use the Gemini API with audio files. | |
| JSON mode | Discover how to use JSON mode. | |
| Enum | Constrain model outputs using Enums. | |
| PDF files | Learn how to work with PDF files, and upload text and images. | |
| System Instructions | Give models additional context on how to respond by setting system instructions. | |
| Streaming | Learn how to use streaming for single interactions, and for chat. | |
| Embeddings | Create high-quality and task-specific embeddings. | |
| Caching | Learn how to use context caching to reduce costs and latency on repetitive tasks. | |
| Error handling | Learn best practices for error handling and retry logic with the Gemini API. | |
| Prompting | Master prompting techniques including few-shot, system instructions, and multimodal prompts. | |
| Safety | Learn how to configure safety thresholds and content moderation filters. | |
| AI Tutors with LearnLM | Demonstrates how to craft AI tutoring experiences using system instructions aligned with learning science principles. |