Gemini Setup (CLI)

Point the Gemini CLI at the CQT AI 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 CQT AI 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:

# 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):

GOOGLE_GEMINI_BASE_URL=https://api.cqtai.com/gemini
GEMINI_API_KEY=your-APIKey

Step 3: Verify

Run gemini in the terminal and chat to test that the setup works:

gemini

Field reference

  • GOOGLE_GEMINI_BASE_URL: the CQT AI 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.