# Connect Google Gemini (UI)

This guide walks you through connecting Google Gemini to your Genie server using the dashboard UI. You can optionally supply your own Google Cloud Project ID to avoid free-tier rate limits.

***

## Prerequisites

* A Genie account with a running server
* A Google account (personal or Google Workspace)
* **(Recommended)** A Google Cloud Platform project — required for Google Workspace or organization accounts

***

## Step 1: Open LLM Integrations

Go to your Genie dashboard → **Settings** → **Server**. Scroll down to **LLM Integrations** and select the **Gemini** tab.

You will see the Gemini CLI setup with an optional Google Cloud Project ID field.

![Server settings showing Gemini tab with Project ID field](/files/3cqa1E3eUUHIWnaQnwd5)

***

## Step 2: Get a Google Cloud Project ID

Supplying your own GCP Project avoids free-tier rate limits. This step is **required** for Google Workspace or organization accounts.

1. Go to [console.cloud.google.com](https://console.cloud.google.com)
2. Select an existing project or create a new one
3. Enable the **Gemini for Google Cloud** API:
   * Navigate to **APIs & Services** → **Library**
   * Search for "Gemini for Google Cloud"
   * Click **Enable**
4. Copy the **Project ID** from the dashboard

![Google Cloud Console showing Project ID](/files/mfh2czhNaaDm8IBjTgZv)

***

## Step 3: Enter Project ID

Back in Genie settings, paste your Project ID into the input field. Click **Continue to sign in**.

If you don't have a GCP Project ID, leave the field blank and click **Skip & sign in** instead.

![Project ID entered in Genie settings](/files/zwUYv7UeJldgupANu2gB)

***

## Step 4: Sign In with Google

A new tab opens to a Google sign-in dialog. Review the safety notice, confirm your account, and click **Sign in** to authorize access.

![Google sign-in dialog for Gemini](/files/m3ZRTp1iyn7Gle8EFp7O)

***

## Step 5: Copy the Callback URL

Your browser redirects to a `localhost` URL. This will show a **connection error** — this is expected on remote servers.

Copy the **full URL** from your browser's address bar.

![Browser showing localhost connection error — copy the full URL](/files/HwdSR8YBIOOF3yyYD4zL)

***

## Step 6: Paste the URL in Genie

Go back to the Genie settings tab. Paste the callback URL into the input field and click **Connect**. If you entered a Project ID earlier, you will see a green confirmation showing it is set.

![Paste callback URL and click Connect](/files/pZ83zz3k3Zdmik2Ahxyj)

***

## Step 7: Connected

All steps show green checkmarks. You will see the message: **"Gemini CLI connected — your server is ready!"**

![Successful Gemini connection with all green checkmarks](/files/5a8h1FKSWi44oQbHxVFW)

Your server is now using Google Gemini for AI interactions.

***

## Tips

* Supplying a **GCP Project ID** avoids free-tier rate limits — highly recommended for serious use
* **Google Workspace** or organization accounts require a GCP Project ID
* The localhost connection error in Step 5 is expected — just copy the URL from the address bar
* To verify the connection, go to Chat and send a message to Genie
* You can switch between LLM providers (Claude, Codex, Gemini) from the same LLM Integrations panel


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.deva.me/guides/connect-gemini.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
