google-gemini /cookbook

Examples and guides for using the Gemini API

★ 17,944⑂ 2,835👁 213⑃ 1,157● 347▤ 0
Jupyter NotebookApache-2.0Created 2024-03-13ai.google.dev/gemini-api/docs
+4
Daily
17,944
stars
2,835
forks
213
watchers
1,157
prs
347
issues
0
releases

README

Welcome to the Gemini API Cookbook

This cookbook provides a structured learning path for using the Gemini API, focusing on hands-on tutorials and practical examples.

For comprehensive API documentation, visit ai.google.dev.

For Gemma quickstarts and examples, check out the Gemma cookbook.


---
 Gemini 4 Hydrogen, Carbon & Argon: Start with Gemini 4 Hydrogen (gemini-4-hydrogen), the new default Gemini 4 model available on both the free and paid tiers for fast everyday coding, multimodal workflows, and tool-using agents (with four thinking levels up to xhigh), alongside Gemini 4 Carbon (gemini-4-carbon) for maximum reasoning depth and Gemini 4 Argon (gemini-4-argon) for fast frontier reasoning—all featuring a unified 1M context window and long decode up to 1M output tokens. Explore the Get Started  and Thinking  guides, including the migration guide.

 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.

 🎙️ Gemini 3.8 TTS & Custom Voices: Generate expressive single- and multi-speaker speech with Gemini 3.8 TTS , and design custom voices from text or replicate voices from audio with the new Voices guide !

 Omni Flash: The Nano Banana of video editing is here! Learn how to call the model using the interactions API, edit videos with natural language and more here !
 
 🍌 Nano-Banana 2.1: Go bananas with our latest image generation model: Nano-Banana 2.1. Get started here  with 512px, thinking, search and image grounding, and a ton of examples!
 
 🎶 Lyria 3.5: Channel your inner composer with Lyria 3.5. Get started here  with full song generation, image-to-music, and a ton of examples!
 
 Agents API: Create and run your custom agents using the new Antigravity agent !

 Decisions API: Answer typed yes/no (noul), choice, and score questions with calibrated probabilities and zero output token cost. Get started with the Decisions API guide !

---

 Navigating the Cookbook

This cookbook is organized into two main categories:

1.  Quick Starts:  Step-by-step guides covering both introductory topics ("Get Started ") and specific API features.
2.  Examples: Practical use cases demonstrating how to combine multiple features.

We also showcase Demos in separate repositories, illustrating end-to-end applications of the Gemini API.


 What's New?

Here are the recent additions and updates to the Gemini API and the Cookbook: 
 Gemini 4 Hydrogen: The fast, cost-efficient daily driver in the Gemini 4 series—available on both the free and paid tiers with a unified 1M context window, long decode continuation up to 1M output tokens, and thinking levels up to xhigh (gemini-4-hydrogen is now the default across Cookbook quickstarts). Start building in the Get Started guide .
 Decisions API: Answer typed yes/no (noul), choice, and score questions with calibrated probabilities and zero output token cost using

Top issues

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON