> ## Documentation Index
> Fetch the complete documentation index at: https://help.emergent.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Gemini (Google AI) Integration

> Add Google Gemini AI to your app

## What is Gemini?

Gemini is Google's most advanced AI. It's incredibly fast, can handle images and video, and works in over 100 languages. Perfect for apps that need powerful AI features.

**Perfect for:**

* AI chatbots and assistants
* Image and video analysis
* Multilingual applications
* Fast AI responses
* Code generation

## The Easy Way: Emergent Universal Key

<Note>
  **Good news!** You don't need to create a Gemini account. Emergent provides a Universal Key that works with OpenAI, Claude, and Google AI - all in one!\
  \
  **TLDR**: View our article on the [Universal Key](/features/universal-key) to get started.
</Note>

### How to Get It

<Steps>
  <Step title="Click Your Profile">
    In Emergent, click your profile picture (top right)
  </Step>

  <Step title="Go to Universal Key">
    Select **Universal Key** from the menu
  </Step>

  <Step title="View Your Key">
    Your key is displayed there
  </Step>

  <Step title="Add Credits">
    Click **Add Balance** to add credits (starts at \$10)
  </Step>

  <Step title="Done!">
    You're ready to use Gemini!
  </Step>
</Steps>

**Pricing:** Pay only for what you use

* Gemini Flash: \~\$0.00004 per 750 words (super cheap!)
* Gemini Pro: \~\$0.0005 per 750 words

## Step 2: Tell the Agent What You Want

Describe what you're building:

### Example 1: Fast AI Chatbot

```
I want a super fast AI chatbot using Gemini.

Features:
- Quick responses
- Remembers conversation
- Friendly and helpful
- Works in multiple languages

Use Emergent Universal Key.
Use Gemini Flash (fastest).

Please set this up.
```

### Example 2: Image Analysis

```
Build an image analyzer with Gemini.

Features:
- Users upload images
- Gemini describes what's in the image
- Can answer questions about the image
- Identify objects, text, and scenes

Use Emergent Universal Key.
Use Gemini Pro.

Please build this.
```

### Example 3: Multilingual Assistant

```
Create a multilingual AI assistant.

Features:
- Detects user's language automatically
- Responds in same language
- Supports: English, Spanish, French, Hindi, Chinese
- Translates if needed

Use Emergent Universal Key.
Use Gemini Flash.

Please set this up.
```

<Tip>
  **That's it!** The agent handles all the technical integration.
</Tip>

## Choose Your Gemini Model

<CardGroup cols={2}>
  <Card title="Gemini Flash" icon="bolt" color="#10b981">
    **Best for:** Most things

    **Speed:** Very fast!

    **Cost:** Super cheap

    **Recommended!**
  </Card>

  <Card title="Gemini Pro" icon="brain" color="#3b82f6">
    **Best for:** Complex tasks

    **Speed:** Fast

    **Cost:** Still affordable

    More powerful
  </Card>
</CardGroup>

**Not sure?** Start with **Gemini Flash** - it's incredibly fast and cheap!

## Step 3: Test Your AI

After setup:

<Steps>
  <Step title="Click Preview">
    In Emergent, click **Preview**
  </Step>

  <Step title="Send Test Message">
    Try asking a question
  </Step>

  <Step title="Check Speed">
    Gemini is usually super fast!
  </Step>

  <Step title="Test Images">
    If using vision, upload an image
  </Step>

  <Step title="Try Languages">
    Test in different languages
  </Step>

  <Step title="Verify Quality">
    Make sure responses are helpful
  </Step>
</Steps>

## Managing Your Credits

### Check Your Balance

1. Profile → Universal Key
2. See remaining credits
3. View usage history

### Add More Credits

1. Click **Add Balance**
2. Choose amount ($10, $25, \$50, or custom)
3. Complete payment
4. Credits added instantly!

<Note>
  Gemini is so cheap that credits last a long time - Flash model can handle millions of words for \$100.
</Note>

## Common Questions

<AccordionGroup>
  <Accordion title="Gemini vs GPT vs Claude?">
    **Gemini is great for:**

    * Super fast responses
    * Image/video analysis
    * Multilingual apps
    * Budget-friendly AI
    * Long conversations (huge context)

    **GPT is great for:**

    * Creative writing
    * Code generation
    * Complex reasoning

    **Claude is great for:**

    * Thoughtful responses
    * Document analysis
    * Following instructions

    **Best approach:** Try all three!
  </Accordion>

  <Accordion title="Can Gemini see images?">
    Yes! Gemini has great vision capabilities. Tell the agent:

    ```
    Let users upload images.
    Gemini should:
    - Describe what's in the image
    - Answer questions about it
    - Read text from images
    - Identify objects
    ```
  </Accordion>

  <Accordion title="Can Gemini analyze videos?">
    Yes! Tell the agent:

    ```
    Users can upload videos.
    Gemini should:
    - Summarize the video
    - Answer questions about content
    - Identify scenes and actions
    ```
  </Accordion>

  <Accordion title="How much does it cost?">
    **Super cheap!**

    **Gemini Flash:** \~\$0.00004 per 750 words

    * 1,000 conversations: \~\$0.60
    * 100,000 messages: \~\$60

    **Gemini Pro:** \~\$0.0005 per 750 words

    * Still very affordable

    Cheapest AI option available!
  </Accordion>
</AccordionGroup>

## Something Not Working?

### Gemini Not Responding

**Tell the agent:**

```
Gemini isn't responding to messages.
Can you check the integration?
```

### Image Analysis Not Working

**Tell the agent:**

```
Images upload but Gemini doesn't analyze them.
Can you debug the vision feature?
```

### Wrong Language

**Tell the agent:**

```
Gemini responds in wrong language.
Should detect user's language and respond in same language.
Can you fix this?
```

## Real Examples

### Example 1: Visual Search

```
Build a visual search with Gemini.

Features:
- User uploads photo of product
- Gemini identifies it
- Shows similar products
- Provides details and price

Use Emergent Universal Key with Gemini Pro.

Please build this.
```

### Example 2: Study Helper

```
Create a study assistant for students.

Features:
- Students upload homework photos
- Gemini helps explain concepts
- Answers questions
- Shows step-by-step solutions
- Supports multiple languages

Use Emergent Universal Key with Gemini Flash.

Please set this up.
```

### Example 3: Content Moderation

```
Automatic content moderation with Gemini.

Features:
- Check uploaded images for inappropriate content
- Analyze text for policy violations
- Flag suspicious content
- Provide moderation reasons

Use Emergent Universal Key with Gemini Flash.

Please build this.
```

## Advanced Features

### Long Conversations

```
Gemini supports very long conversations.
Enable extended context:
- Remember entire conversation history
- Reference earlier messages
- Maintain context for hours
```

### Function Calling

```
Let Gemini use tools:
- Call weather API
- Search database
- Send emails
- Execute actions

Based on user requests.
```

### Streaming Responses

```
Show Gemini's response as it generates:
- Word by word
- Real-time streaming
- Feels more interactive
```

## Alternative: Use Your Own Google AI Key

If you prefer your own Google Cloud account:

<Steps>
  <Step title="Go to Google AI Studio">
    Visit [aistudio.google.com](https://aistudio.google.com)
  </Step>

  <Step title="Get API Key">
    Click **Get API Key**

    Create or select a project
  </Step>

  <Step title="Copy Key">
    Copy your API key
  </Step>

  <Step title="Tell Agent">
    ```
    Use my Google AI API key instead of Emergent Universal Key:
    AIzaSy...
    ```
  </Step>
</Steps>

## Quick Checklist

Before going live:

* Tested text conversations
* Tested image analysis (if using)
* Tried different languages (if multilingual)
* Speed is satisfactory
* Responses are accurate
* Added enough credits
* Set up auto-recharge (optional)

## Remember

**Super fast** - Gemini Flash is incredibly quick

**Very cheap** - Most affordable AI option

**Great vision** - Excellent at analyzing images

**100+ languages** - True multilingual support

**Use Emergent Universal Key** - Easiest setup

<Info>
  Stuck? Tell the agent: "I need help with Gemini integration" and describe what you want to change or fix.
</Info>
