google-gemini/cookbook

Examples and guides for using the Gemini API

What it is

A collection of hands-on tutorials (called a "cookbook") for learning how to use Google's Gemini API. It's organized as a structured learning path with practical examples rather than just reference documentation.

What's inside

The project is split into two main sections:

  • Quick Starts — Step-by-step guides for beginners and for specific API features (e.g., getting started, text-to-speech, video generation, image generation, music generation, live audio streaming, transcription, and more).
  • Examples — Practical use cases that show how to combine multiple features together.

There are also separate repositories for full end-to-end demo applications.

Format

Most tutorials are Jupyter notebooks, each with a one-click "Colab" button so you can run them in Google's free cloud notebook environment without installing anything locally.

What you need to begin

  1. A Google account
  2. An API key, created in Google AI Studio

The README recommends starting with the Authentication guide (to set up your API key) and the Get Started guide (covering basic prompting and multimodal input).

Notable features covered

  • Gemini 4 Argon — a reasoning model supporting up to 1M output tokens and adjustable "thinking" levels
  • Gemini 3.8 Flash — a fast model aimed at software engineering, autonomous agents, and enterprise workflows
  • Gemini 3.5 Flash-Lite — the fastest, lowest-cost model in the 3.5 family
  • Text-to-speech — expressive single- and multi-speaker speech, plus custom voice design (from text prompts) and voice replication (from audio samples)
  • Video — conversational video generation and editing (Omni Flash), plus video generation (Veo)
  • Image generation — Nano-Banana 2.1 (512px, with thinking and search grounding) and Nano-Banana Pro (4K quality)
  • Music — full song generation and image-to-music with Lyria 3.5, plus real-time interactive music streams
  • Agents API — create and run custom agents in a controlled environment
  • Live API — low-latency voice/video streaming, real-time translation of audio streams, and extended thinking in live sessions
  • Transcription — audio files and live streams with word-level timestamps, speaker diarization, and custom vocabulary
  • Grounding — connect responses to Google Search results, Google Maps data, or your own files (hosted RAG)
  • Code execution — have the model generate and run Python code to solve tasks and output graphs
  • Webhooks — real-time notifications for async operations like batch jobs and video generation
  • Inference tiers — Priority and Flex options to balance speed, cost, and reliability
  • Robotics — a model for spatial understanding and reasoning for robotics applications

Where to find full API documentation

The README points to ai.google.dev for comprehensive API docs, and to a separate Gemma cookbook for Gemma model examples.

Related

  • Project
  • Project
  • Project
  • Project