# Connect blindGram to Google Gemini

A step-by-step guide to connecting blindGram Assistant to Google Gemini using a free API key. Learn how to obtain your key from Google AI Studio, configure model settings, and solve common connection issues.

Google Gemini provides advanced visual understanding for image descriptions, voice message summaries, and interactive questions directly inside blindGram.

## Prerequisites

Before starting, ensure you have:
- An Android device running blindGram with **blindGram Assistant** installed.
- A standard Google Account to sign in to Google AI Studio.
- A stable internet connection.

## Step 1: Get a free API key from Google AI Studio

Google provides free tier API keys for personal use with Google Gemini:

1. Open [Google AI Studio](https://aistudio.google.com/) in your browser and sign in with your Google account.
2. Tap the **Get API key** button (usually in the left sidebar or top banner).
3. Select **Create API key**. If prompted, choose an existing Google Cloud project or select **Create API key in new project**.
4. A dialog appears displaying your new key (a string starting with `AIza...`).
5. Tap **Copy** to copy the key to your clipboard.

> **Security Note:** Treat your API key like a password. Do not share it publicly. It is stored securely on your phone and sent directly only to Google's API endpoint.

## Step 2: Enter your key in blindGram Assistant

1. Open **blindGram** on your phone.
2. Open the main menu and go to **Settings** > **blindGram Area** > **Assistant** > **AI**.
3. Under the **The service** section:
   - Tap **Provider** and select **Gemini** from the list.
   - Tap **API key** and paste the key you copied from Google AI Studio.
   - Tap **Save** or confirm the entry.

## Step 3: Choose a Gemini model

In the **Model** row, you can select which Gemini model processes your requests:

- **Gemini 1.5 Flash / Gemini 2.0 Flash (Recommended):** Fast, accurate, and lightweight. Best for instant image descriptions, quick summaries, and low latency on screen readers.
- **Gemini 1.5 Pro:** High reasoning capability and detailed scene analysis, ideal when analyzing complex charts, documents, or intricate photos.
- **Other model / Load models:** Lets you fetch the live catalog of available models from Google or type a custom model ID.

## Step 4: Turn on AI features

All AI features remain off by default until you enable them. Turn on the options you need:

- **Detailed image description:** Go to **Describe image** and toggle on **Detailed description**. When you share or view a photo, blindGram will send it to Gemini for a comprehensive spoken description.
- **Voice summaries:** In **Voice summary**, toggle on **Summarize with AI**. A **Summarize voice** button will appear in the action menu for any voice message.
- **Text summaries:** In **Text summary**, enable **Summarize messages** to quickly condense long messages into short bullet points.
- **Ask AI about messages:** Under **Ask about messages**, enable **Ask AI about any message** to start an interactive Q&A conversation about any photo, voice note, or text message.

## Troubleshooting Common Problems

### Problem: "API Key Invalid" error
- **Cause:** The copied string may have missing characters or extra spaces.
- **Solution:** Return to Google AI Studio, click **Copy** again, and ensure no leading or trailing whitespace is pasted into the blindGram text field.

### Problem: "Quota Exceeded" or HTTP 429 error
- **Cause:** Google's free tier has rate limits per minute (RPM) and requests per day (RPD).
- **Solution:** Wait 60 seconds before retrying. If you frequently reach limits, verify your quota usage on the Google AI Studio dashboard or consider rotating keys.

### Problem: Connection timeout or unable to reach server
- **Cause:** In some network environments or countries, Google API endpoints (`generativelanguage.googleapis.com`) may be filtered or restricted.
- **Solution:** Verify that your network connection allows access to Google services. If using a proxy, ensure the assistant connection is routed through your working proxy.

### Problem: Speech model missing for voice summaries
- **Cause:** Google Gemini does not host a standalone speech recognition endpoint.
- **Solution:** blindGram Assistant automatically uses the speech recognition engine installed on your phone to transcribe the voice recording first, then sends the transcript to Gemini for summarization. Make sure your on-device speech engine has the matching language pack installed.

## Frequently Asked Questions

### Is connecting to Google Gemini free?
Yes. Google AI Studio offers a free tier that is sufficient for personal daily use in blindGram.

### Are my messages and photos stored by Google?
Requests are sent directly to Google's Generative Language API. Refer to Google AI Studio's terms of service regarding data logging policies on free vs paid tiers.

### How do I view past AI answers?
All generated descriptions, summaries, and Q&A threads are saved in [AI Conversations](/docs/assistant/ai/conversations/) for up to one week.
