Google AI

Setup Google Generative AI provider and learn how to use its models like Gemini in the starter kit.

The Google Generative AI provider integrates Google's state-of-the-art models, including the versatile Gemini family, into your applications through the AI SDK.

Google Generative AI

Setup

Generate API Key

Visit the Google AI Studio to create your API key. For enterprise applications using Google Cloud, you can alternatively configure authentication via Application Default Credentials or service accounts.

Add API Key to Environment

Add your API key to your project's .env file (e.g., in apps/web):

.env
GOOGLE_GENERATIVE_AI_API_KEY=your-api-key

If using Google Cloud credentials instead, ensure they're properly configured in your environment.

Configure Provider (Optional)

The starter kit automatically uses the GOOGLE_GENERATIVE_AI_API_KEY environment variable. For advanced configurations (such as proxies, custom API versions, or specific headers), you can create a tailored provider instance using createGoogleGenerativeAI. See the AI SDK Google documentation for comprehensive details.

Features

Use Cases

AI Chatbot

Create sophisticated conversational agents powered by Gemini models that can engage in natural dialogue and handle complex, multi-step tasks. Experience this in our Chat Demo.

Content Generation

Generate diverse text formats, from creative writing and marketing copy to code explanations and summaries.

Multimodal Applications

Build applications that seamlessly analyze and understand images, documents, and other file types alongside text, creating richer, more contextual user experiences.

Semantic Search & RAG

Implement powerful search capabilities or sophisticated Retrieval-Augmented Generation systems using Google's high-performance embedding models for more accurate information retrieval.

Automated Workflows

Streamline operations by connecting language models to external tools and APIs through function calling, automating complex business processes and repetitive tasks with minimal human intervention.

How is this guide?

Last updated on

On this page

Make AI your edge, not replacement.