# Gemini Setup (CLI)

Point the Gemini CLI at the NovAPI gateway via its config file to use the platform's Gemini-compatible models.

> 💡 Beginner tip: graphical setup with **CC-Switch** is easier (see "CC-Switch Setup" on the left). The manual setup is below.

## Prerequisites

- You've obtained a NovAPI APIKey (created in the console under "APIKey Management").
- You've installed the Gemini CLI.

## Step 1: Open the config folder

Open your terminal and run the command for your OS to open the Gemini config folder:

```bash
# Windows (CMD)
start "" "%USERPROFILE%\.gemini"

# macOS / Linux
open "$HOME/.gemini"
```

## Step 2: Create the .env file

Manually create a `.env` file in that folder with the following content (replace the APIKey with your own):

```bash
GOOGLE_GEMINI_BASE_URL=https://api.novapi.ai
GEMINI_API_KEY=your-APIKey
```

## Step 3: Verify

Run `gemini` in the terminal and chat to test that the setup works:

```bash
gemini
```

## Field reference

- `GOOGLE_GEMINI_BASE_URL`: the NovAPI Gemini gateway address.
- `GEMINI_API_KEY`: your APIKey.

## FAQ

- **401 authentication failed**: Check that `GEMINI_API_KEY` is correct with no extra spaces, and confirm the APIKey isn't disabled.
- **Connection failed**: Confirm `GOOGLE_GEMINI_BASE_URL` is correct and the network is reachable.
- **Config doesn't take effect**: Confirm `.env` is inside the `.gemini` folder, then reopen the terminal after saving.
