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

# Gemini

> Connect Google Gemini to Rocket and add multimodal AI to your app: image analysis, visual search, and text generation in one integration.

export const LlmsDirective = () => <blockquote className="llms-directive">
    For the complete documentation index, see <a href="/llms.txt">llms.txt</a>.
    For a lightweight markdown version of this page, append .md to the URL.
  </blockquote>;

<LlmsDirective />

Connect your Gemini API key and describe the AI feature you need in chat. Rocket handles all the integration code automatically so you can focus on what your features should do.

<Note>
  This connector is only available for **Next.js TypeScript** web build tasks.
</Note>

<Divider />

## What you can do

<CardGroup cols={2}>
  <Card title="Image analysis" icon="image">
    Let users upload images and get detailed descriptions, alt text, or extracted information using Gemini's vision capabilities.
  </Card>

  <Card title="Multimodal chat" icon="comments">
    Let users send both text and images in a conversation, with Gemini responding using context from both.
  </Card>

  <Card title="Content generator" icon="wand-magic-sparkles">
    Generate blog posts, product descriptions, social media copy, or marketing content from simple prompts.
  </Card>

  <Card title="Visual search" icon="magnifying-glass-plus">
    Let users search by uploading an image and finding similar items or related information.
  </Card>

  <Card title="Document OCR" icon="file-invoice">
    Extract text, tables, and structured data from photos of documents, receipts, or handwritten notes.
  </Card>
</CardGroup>

<Divider />

## Before you connect

<Card icon="link" horizontal href="https://aistudio.google.com/app/apikey" arrow="true">
  **Get your Gemini API key** from Google AI Studio.
</Card>

<Warning>
  Never paste your API key directly into chat. Always use the secure connector flow. If you believe your key has been exposed, rotate it immediately from [Google AI Studio](https://aistudio.google.com/app/apikey).
</Warning>

<Note>
  The API key is scoped to the task you connect it in. Each task stores its own key. Connecting in one task does not affect others.
</Note>

<Divider />

## Connect Gemini

<Tabs>
  <Tab title="Web Browser">
    You can connect from two places. Both open the same popup.

    **Option 1: From chat**

    Type a prompt that mentions Gemini, for example `Connect Gemini and add an image upload that generates descriptions and alt text`. Rocket detects the intent and shows a **Connect** button inline. Click it and the popup opens.

    <Frame caption="Gemini connection prompt in chat">
      <img src="https://mintcdn.com/dhiwisepvtltd-5e04e6a4/vpU7U-5j_1cvxMQa/images/build-docs/connectors/gemini/web-browser/gemini-chat-light.webp?fit=max&auto=format&n=vpU7U-5j_1cvxMQa&q=85&s=d3e6f4a1cb368e9d0ee760782867dcba" alt="Gemini connection prompt in the Rocket chat panel." className="theme-image light-image" width="2880" height="1624" data-path="images/build-docs/connectors/gemini/web-browser/gemini-chat-light.webp" />

      <img src="https://mintcdn.com/dhiwisepvtltd-5e04e6a4/vpU7U-5j_1cvxMQa/images/build-docs/connectors/gemini/web-browser/gemini-chat-dark.webp?fit=max&auto=format&n=vpU7U-5j_1cvxMQa&q=85&s=2988a9b55024f1ea492f0c95e55c5c14" alt="Gemini connection prompt in the Rocket chat panel." className="theme-image dark-image" width="2880" height="1624" data-path="images/build-docs/connectors/gemini/web-browser/gemini-chat-dark.webp" />
    </Frame>

    **Option 2: From the Connectors tab**

    Click the **`...`** button in the preview toolbar, then select **Connectors**.

    <Frame caption="Open Connectors from the toolbar">
      <img src="https://mintcdn.com/dhiwisepvtltd-5e04e6a4/2lqYWidv_xVHKfL6/images/build-docs/connectors/shared/connectors-tab-open-light.webp?fit=max&auto=format&n=2lqYWidv_xVHKfL6&q=85&s=7bd785a0e878564054e08328b2aa3d6b" alt="Toolbar dropdown with Connectors option highlighted." className="theme-image light-image" width="2880" height="1624" data-path="images/build-docs/connectors/shared/connectors-tab-open-light.webp" />

      <img src="https://mintcdn.com/dhiwisepvtltd-5e04e6a4/2lqYWidv_xVHKfL6/images/build-docs/connectors/shared/connectors-tab-open-dark.webp?fit=max&auto=format&n=2lqYWidv_xVHKfL6&q=85&s=d047040372d776cb47e4e483de8eeb8d" alt="Toolbar dropdown with Connectors option highlighted." className="theme-image dark-image" width="2880" height="1624" data-path="images/build-docs/connectors/shared/connectors-tab-open-dark.webp" />
    </Frame>

    Click the **Gemini** card, then click **Connect**.

    <Frame caption="Gemini card in the Connectors panel">
      <img src="https://mintcdn.com/dhiwisepvtltd-5e04e6a4/vpU7U-5j_1cvxMQa/images/build-docs/connectors/gemini/web-browser/gemini-connectors-tab-light.webp?fit=max&auto=format&n=vpU7U-5j_1cvxMQa&q=85&s=5ab671d8eac1e091b3433b69b3d36f8c" alt="Connectors panel showing the Gemini card with a Connect button." className="theme-image light-image" width="1780" height="518" data-path="images/build-docs/connectors/gemini/web-browser/gemini-connectors-tab-light.webp" />

      <img src="https://mintcdn.com/dhiwisepvtltd-5e04e6a4/vpU7U-5j_1cvxMQa/images/build-docs/connectors/gemini/web-browser/gemini-connectors-tab-dark.webp?fit=max&auto=format&n=vpU7U-5j_1cvxMQa&q=85&s=a13c4aec9c64e868d0a94be0e0fecffd" alt="Connectors panel showing the Gemini card with a Connect button." className="theme-image dark-image" width="1787" height="525" data-path="images/build-docs/connectors/gemini/web-browser/gemini-connectors-tab-dark.webp" />
    </Frame>

    **After clicking Connect**

    A popup opens. Paste your **API key** and click **Connect**.

    <Frame caption="Connect Gemini popup">
      <img src="https://mintcdn.com/dhiwisepvtltd-5e04e6a4/vpU7U-5j_1cvxMQa/images/build-docs/connectors/gemini/web-browser/gemini-popup-light.webp?fit=max&auto=format&n=vpU7U-5j_1cvxMQa&q=85&s=9d6b54d20b74c111b5414be0ffb42dc4" alt="Connect Gemini popup with an API key input field." className="theme-image light-image" width="840" height="500" data-path="images/build-docs/connectors/gemini/web-browser/gemini-popup-light.webp" />

      <img src="https://mintcdn.com/dhiwisepvtltd-5e04e6a4/vpU7U-5j_1cvxMQa/images/build-docs/connectors/gemini/web-browser/gemini-popup-dark.webp?fit=max&auto=format&n=vpU7U-5j_1cvxMQa&q=85&s=94387163d4f6d068f2f1c115f2e32758" alt="Connect Gemini popup with an API key input field." className="theme-image dark-image" width="840" height="500" data-path="images/build-docs/connectors/gemini/web-browser/gemini-popup-dark.webp" />
    </Frame>

    A green dot appears next to Gemini when the connection is active.

    **Update or disconnect**

    Go to [**Connectors > Gemini**](#connect-gemini). Click **Edit** to update the key or **Disconnect** to remove the integration.

    <Frame caption="Edit and Disconnect options on a connected Gemini card">
      <img src="https://mintcdn.com/dhiwisepvtltd-5e04e6a4/vpU7U-5j_1cvxMQa/images/build-docs/connectors/gemini/web-browser/gemini-disconnect-light.webp?fit=max&auto=format&n=vpU7U-5j_1cvxMQa&q=85&s=8c29146f2fb164ac2d60e2db2c12c230" alt="Gemini card showing Edit and Disconnect buttons." className="theme-image light-image" width="1786" height="519" data-path="images/build-docs/connectors/gemini/web-browser/gemini-disconnect-light.webp" />

      <img src="https://mintcdn.com/dhiwisepvtltd-5e04e6a4/vpU7U-5j_1cvxMQa/images/build-docs/connectors/gemini/web-browser/gemini-disconnect-dark.webp?fit=max&auto=format&n=vpU7U-5j_1cvxMQa&q=85&s=5fc19770fda90e4047b19129dfe622eb" alt="Gemini card showing Edit and Disconnect buttons." className="theme-image dark-image" width="1785" height="520" data-path="images/build-docs/connectors/gemini/web-browser/gemini-disconnect-dark.webp" />
    </Frame>
  </Tab>

  <Tab title="Mobile App">
    Open the task in the Rocket mobile app. Tap the **More** button in the header, then tap **Connectors**. Tap the **Gemini** card and enter your API key.
  </Tab>
</Tabs>

<Divider />

## Example prompts

| Use case               | Prompt                                                                                                       |
| :--------------------- | :----------------------------------------------------------------------------------------------------------- |
| Image description      | `Add an image upload that uses Gemini to generate a detailed description and alt text.`                      |
| Photo search           | `Build a visual search where users upload a product photo and Gemini identifies similar items.`              |
| Document scanner       | `Create a receipt scanner that extracts line items, totals, and dates from uploaded photos.`                 |
| Content writer         | `Build a blog post generator where users enter a topic and Gemini writes a draft with headings.`             |
| Image chat             | `Add a chat widget where users can attach images and Gemini responds with context from both text and image.` |
| Social media generator | `Generate Instagram captions and hashtags from an uploaded product photo using Gemini.`                      |
| Diagram explainer      | `Let users upload a diagram or flowchart and Gemini explains each step in plain language.`                   |
| Product catalog        | `Auto-generate product descriptions and categories from uploaded product images using Gemini.`               |
| Handwriting reader     | `Build a tool that converts handwritten notes to typed text using Gemini vision.`                            |
| Quiz generator         | `Create a quiz from an uploaded textbook page using Gemini to extract key concepts and questions.`           |

<Divider />

## Tips

* **Best for multimodal tasks.** If your app needs to understand images, screenshots, or documents alongside text, Gemini is the strongest choice among Rocket's AI connectors.
* **Image size limits apply.** Images passed inline must be under 20MB per request. For larger files, Rocket uses the Gemini Files API which supports up to 100MB.
* **API billing is separate from Rocket.** Google charges based on token usage and input type. Image inputs consume more tokens than text. See [Google AI pricing](https://ai.google.dev/pricing).
* **Key is scoped to this task.** Each Rocket task connects to one Gemini API key.
