Open-source project
google-gemini/cookbook avatar
google-gemini/cookbook

google-gemini/cookbook: What the Gemini API Notebooks Actually Cover

Examples and guides for using the Gemini API

17,800 stars2,787 forksJupyter NotebookApache-2.0

At a glance

What is it?
The Gemini API cookbook is a set of Jupyter notebooks split into quickstarts and examples. It teaches the API by running it, and it is not a library you install.
Who is it for?
Adopt it if you learn by executing code and want runnable notebooks for Gemini API features such as thinking, image generation, video editing, webhooks and inference tiers. Skip it if you need a versioned SDK, an offline reference or a stable API contract, because the repository is documentation and the real reference lives at ai.google.dev.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 5 days ago.
What is it written in?
Mainly Jupyter Notebook, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 27, 2026, and from our analysis. They are not legal advice.

Editorial analysis

Who the Gemini API cookbook is for, and what it replaces

The README describes the repository as a structured learning path for the Gemini API, built from hands-on tutorials and practical examples. That framing matters. This is not an SDK, not a wrapper, and not a service. It is a set of Jupyter notebooks that call the API so you can read the request, run it, and inspect the response. The intended reader is a developer who has an API key, some Python or JavaScript fluency, and a question like how do I stream a response or how do I ground an answer in my own files. If your question is what is the exact rate limit for a given tier, the README points you elsewhere: for comprehensive API documentation it sends you to ai.google.dev. The cookbook teaches usage patterns, the official docs define the contract. Keeping those two roles separate saves time, because a notebook that demonstrates a feature is not a specification of it. The repository also draws a boundary around Google's other model family. Gemma quickstarts and examples live in a separate repository, google-gemma/cookbook, so anyone working with Gemma weights rather than the hosted Gemini API is in the wrong place.

How the cookbook is organized: quickstarts, examples, and a JavaScript track

The README splits the content into two categories. Quick Starts are step-by-step guides covering introductory topics such as Get Started alongside specific API features. Examples are practical use cases that combine multiple features. The repository layout matches that description: there are quickstarts/, examples/, quickstarts-js/, tools/, a .devcontainer/ directory and a .gemini/ directory at the top level. The examples directory is where the breadth shows. File names indicate the range: Analyze_a_Video_Summarization.ipynb, Anomaly_detection_with_embeddings.ipynb, Audio_chord_extraction.ipynb, Citation_Faithfulness_Check.ipynb, GitHub_issue_analyzer.ipynb, Cost_Estimation_And_Health_Monitoring.ipynb, LiveAPI_plotting_and_mapping.ipynb. A few entries are directories rather than notebooks, such as Apps_script_and_Workspace_codelab/, which suggests the material is not strictly one-notebook-per-topic. The presence of quickstarts-js/ is worth noting for anyone who assumed this is Python only. The README does not describe how the JavaScript quickstarts are kept in sync with the Python ones, and that silence is a real gap if you plan to follow one track and occasionally cross-check the other.

Running your first Gemini API notebook from the cookbook

There is no package to install. The README's entry point is the Get Started notebook, and each notebook carries a Colab badge that opens it directly in Google's hosted notebook environment. The badge link points at the raw notebook on the main branch, for example the Get Started notebook with a #gemini3 anchor. Opening that link is the fastest path: Colab supplies the runtime, and the notebook supplies the code. If you prefer to run locally, clone the repository and start Jupyter against the quickstarts directory.

bash
git clone https://github.com/google-gemini/cookbook.git
cd cookbook
jupyter notebook quickstarts/Get_started.ipynb

The README does not print an install command for the Python client library, so treat the notebook cells themselves as the source of truth for imports and setup. For the JavaScript track, the repository keeps a separate quickstarts-js/ directory rather than mixing languages in one folder. The practical consequence is that you should pick a track before you start, because the two directories are parallel structures, not a single interleaved tutorial. What you should see after running the first cells is a model response printed in the notebook output, which is the point of the whole repository: the explanation and the execution sit in the same file.

Where the cookbook stops being the right tool

A notebook collection has a failure mode that a library does not. Nothing here is versioned as a package, so there is no dependency you can pin and no changelog that tells you a demonstrated call signature changed. The README's What's New section is organized around model and feature announcements, which is useful for discovery and unhelpful for stability: it lists additions such as Gemini 3.8 Flash, Gemini 3.5 Flash-Lite, Omni Flash, the Agents API with the Antigravity agent, Webhooks, Inference tiers, Lyria 3.5 and Nano-Banana 2. A reader who copied a cell six months ago has no mechanism in this repository to learn that the surrounding guidance moved. The second limitation is scope. The README explicitly defers comprehensive API documentation to ai.google.dev, so questions about quotas, error semantics or pricing tiers are out of scope by design. Third, the material is notebook-shaped. If you need a function you can import into a service, call in a test suite and mock in CI, you will be writing that layer yourself from what the notebooks show. None of this is a defect in a teaching resource. It is a defect only if you adopt it as something else.

Cookbook versus the official Gemini API documentation

The honest alternative is the documentation site the README itself points to. The difference is not quality, it is genre. The docs at ai.google.dev describe the API surface: parameters, response shapes, limits. The cookbook shows a working sequence: here is a notebook that classifies text with embeddings, here is one that extracts chords from audio, here is one that checks whether a citation is faithful to its source. If you are evaluating whether a capability exists at all, the docs answer faster. If you are trying to get a first result out of that capability, the notebook removes more friction, because the surrounding code is already written and the Colab badge means you do not have to reproduce an environment. A second alternative sits inside Google's own ecosystem: the Gemma cookbook, which the README links for Gemma quickstarts and examples. Choosing between them is a question about which model you are actually calling, not about which repository is better maintained.

Maintenance, licensing and the cost of following along

The repository is not archived, and the last push was on 2026-09-17, which places it within the last week. That is the only maintenance signal available here, and it is a signal about activity, not about backward compatibility. The licence is Apache-2.0, which permits commercial use and modification, and the repository ships a LICENSE file at the top level alongside CONTRIBUTING.md. Apache-2.0 also includes an explicit patent grant, which matters more for a corporate legal review than for a weekend project. This is not legal advice; read the LICENSE file and your own policy. The upgrade cost is unusual for a code repository because there is no upgrade. You do not bump a version. Instead you re-open a notebook and find that the model names and feature coverage have moved, which the What's New list makes visible but does not make automatic. Budget for re-reading the relevant quickstart whenever you touch a model that appears in that list, and treat any code you extracted from a notebook as your own to maintain from the moment you copy it.

Editorial conclusion

Adopt it if you learn by executing code and want runnable notebooks for Gemini API features such as thinking, image generation, video editing, webhooks and inference tiers. Skip it if you need a versioned SDK, an offline reference or a stable API contract, because the repository is documentation and the real reference lives at ai.google.dev. Before committing, open quickstarts/Get_started.ipynb, confirm which model names your project will use, and check the last push date against your own release cycle.

Frequently asked questions

What is google-gemini/cookbook?

It is a repository of examples and guides for using the Gemini API, organized into Quick Starts and Examples. The README describes it as a structured learning path built from hands-on tutorials and practical examples.

Does google-gemini/cookbook cover Gemma models?

No. The README directs readers to the separate Gemma cookbook at google-gemma/cookbook for Gemma quickstarts and examples, while this repository covers the Gemini API.

Where is the full Gemini API reference if the cookbook is not it?

The README states that comprehensive API documentation lives at ai.google.dev, and links to ai.google.dev/gemini-api/docs. The cookbook is the tutorial layer, not the reference.

Is google-gemini/cookbook only Python?

No. The repository contains a quickstarts-js/ directory alongside quickstarts/ and examples/, so there is a JavaScript track, though the README does not explain how the two tracks are kept in sync.

Official sources

  1. google-gemini/cookbook on GitHub
  2. Issues
  3. License: Apache-2.0
  4. Project website
  5. README
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/google-gemini-cookbook.svg)](https://hysenlabs.com/projects/google-gemini-cookbook)