cookbook README

The project's README from github.com/google-gemini/cookbook. As one markdown file: README.md.

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 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 Colab and the thinking Colab guides.

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 Colab!

🍌 Nano-Banana 2: Go bananas with our latest image generation model: Nano-Banana 2. Get started here Colab 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 Colab 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 Colab!


Navigating the Cookbook

This cookbook is organized into two main categories:

  1. Quick Starts: Step-by-step guides covering both introductory topics ("Get Started Colab") 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:



1. Quick Starts

The quickstarts section contains step-by-step tutorials to get you started with Gemini and learn about its specific features.

To begin, you'll need:

  1. A Google account.
  2. An API key (create one in Google AI Studio).



We recommend starting with the following:



Then, explore the other quickstarts tutorials to learn about individual features:



2. Examples (Practical Use Cases)

These examples demonstrate how to combine multiple Gemini API features or 3rd-party tools to build more complex applications.



3. Demos (End-to-End Applications)

These fully functional, end-to-end applications showcase the power of Gemini in real-world scenarios.



Official SDKs

The Gemini API is a REST API. You can call it directly using tools like curl (see REST examples or the great Postman workspace), or use one of our official SDKs:



Get Help

Ask a question on the Google AI Developer Forum.

The Gemini API on Google Cloud Vertex AI

For enterprise developers, the Gemini API is also available on Google Cloud Vertex AI. See this repo for examples.

Contributing

Contributions are welcome! See CONTRIBUTING.md for details.

Thank you for developing with the Gemini API! We're excited to see what you create.

cookbook (google-gemini/cookbook)

Searching Database…

17.9K ·GitHub
这是做什么用的?这是 Google 官方的 Gemini API 实战手册:一条结构化的学习路线,包含动手教程、实用示例,以及指向端到端演示应用的链接,以开源笔记本合集的形式发布。
这是需要安装的库,还是别的东西?都不是——它是一套 Jupyter 笔记本合集,分为 Quick Starts(逐步讲解 API 各项功能的入门指南)和 Examples(组合多个功能的使用案例),演示应用则放在单独的仓库里。
运行之前需要准备什么?只需要一个 Google 账号和一个在 Google AI Studio 里创建的 API 密钥。推荐路径是先按 Authentication 快速入门配好密钥,再学习 Get Started 笔记本,了解基础提示词和多模态输入。
必须用 Python 写吗,还是有其他 SDK?这个 API 基于 REST,所以直接用 curl 也行,官方 SDK 覆盖 Python、Go、Node.js、Java 和 C#。手册自带的笔记本是用 Python 写的。
这是给业余爱好者玩的,还是给企业团队用的?两者都适合:个人可以在 Google AI Studio 里拿一个密钥跟着快速入门走,企业开发者也可以通过 Google Cloud Vertex AI 使用同一个 Gemini API,配套仓库里还有相应示例。
目前手册覆盖了哪些模型和能力?它跟进了最新的 Gemini 版本:3.8 Flash 适合长程编程和智能体,3.5 Flash-Lite 适合高吞吐量场景,Omni Flash 支持对话式视频生成和编辑,Nano Banana 2 和 Pro 支持最高 4K 的图像生成,Lyria 3.5 用于歌曲生成,Gemini Transcribe 用于音频转录。
里面有哪些类型的示例项目?Examples 部分展示的是功能组合:把浏览器当工具做实时网页交互、为开源书籍配插图、由故事生成加 Imagen 和音频合成做出动画故事、实时绘图和地图绘制、3D 场景理解,以及针对 API 用量的成本估算加健康监控。
有没有完整的APP可以学习,而不只是笔记本?有——Demos 部分链接了端到端的应用:面向终端的开源 Gemini CLI 智能体、Python Flask 快速入门、基于 React 的 Multimodal Live API 网页控制台、全栈 LangGraph 起步项目,以及 Google AI Studio 里的一些小应用。
模型能基于搜索结果或我自己的数据来回答吗?可以——Grounding 指南覆盖了 Google 搜索、YouTube、网址,以及较新的 Google Maps grounding 工具;File Search 快速入门则展示了如何用一个托管的 RAG 系统,让生成内容基于你自己的数据。
Size
1002.6 MB
Stars
17.9K
Updated
CommitOct 19
Age
2y
Commits · 90 Days