Skip to main content
Power your Gemini CLI with Aihubmix for stable and efficient Gemini model services.
Official Gemini CLI notice: users on the free tier and Google One users will switch to Antigravity CLI starting June 18, 2026. Setups that use an API key with a custom Base URL are not affected.

Quick Setup Guide:

1️⃣ Global npm Package Installation

Run in terminal
Ensure your Node.js version >= 20 For more detailed information, refer to:
  1. Official Repository
  2. Detailed Configuration

2️⃣ Environment Variable Configuration

Add your Aihubmix API key and forwarding address to your system environment variables. You can generate the API key from the Aihubmix 「Keys」page. For example, add to ~/.zshrc:
For Mac users, you can show hidden .zshrc file in your username directory using shortcut ⌘ + ⇧ + ., then open it with the system “TextEdit” app to add the above content.
Windows PowerShell users can run the following (applies to the current window only):

3️⃣ Apply Configuration

After adding the configuration, execute source ~/.zshrc in terminal and press Enter.

4️⃣ Terminal Launch

Enter in terminal:

Initialization Setup

Choose Connection Method

Gemini CLI authentication screen with Use Gemini API Key selected On first launch, Gemini CLI asks whether you trust the current folder. Select Trust folder, and Gemini CLI restarts automatically. After the restart, the Get started authentication screen appears. If GEMINI_API_KEY is set, Use Gemini API Key is selected by default. Press Enter to confirm:
The Enter Gemini API Key input box then appears, prefilled with the value of GEMINI_API_KEY. Check that the value is correct, then press Enter to submit.
To switch the authentication method later, enter /auth to reopen the authentication screen.

Skip the Interactive Selection (Optional)

To skip the selection at startup, add the following to ~/.gemini/settings.json:

Launch Success

After completing the above initialization, you can use it normally. Gemini CLI conversation after setup is complete

Enjoy using it!

Last updated: 2026-10-19