Skip to content

google-gemini/cookbook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Important: Migration

There are currently two different python SDKs for the Gemini API. This repository is in the process of converting from the old one (google-generativeai) to the new one (google-genai). See the Migration guide for details.

Prefer the google-genai for any new code going forward.

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:



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:

  • Authentication: Set up your API key for access.
  • Get started: Get started with Gemini models and the Gemini API, covering basic prompting and multimodal input.

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 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.