Gemini CLI Quick Start

Install the official Gemini CLI, configure a Modelflare API key and Gemini API endpoint, and verify the connection.

1. Create an API key

Create a Modelflare API key.

2. Install Gemini CLI

npm install -g @google/gemini-cli@latest
gemini --version

3. Configure Modelflare

Replace YOUR_MODELFLARE_API_KEY with your complete Modelflare API key.

Windows PowerShell

$env:GEMINI_API_KEY="YOUR_MODELFLARE_API_KEY"
$env:GOOGLE_GEMINI_BASE_URL="https://modelflare.dev"

Linux or macOS

export GEMINI_API_KEY="YOUR_MODELFLARE_API_KEY"
export GOOGLE_GEMINI_BASE_URL="https://modelflare.dev"

4. Start and test

Replace YOUR_MODEL_ID with a model ID from the Modelflare model catalog. In the same terminal, open your project directory and run:

gemini --model YOUR_MODEL_ID

If prompted, select Use Gemini API key, then send:

Reply with one sentence confirming the connection is working.

A normal reply means setup is complete.