Skip to content
Open CastalyConsole

Coding agents

Gemini CLI setup

Connect the official Gemini CLI to Modelflare with your API key through the native Gemini API.

Create a Modelflare API key.

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

Replace YOUR_MODELFLARE_API_KEY with your complete Modelflare API key.

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

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

Terminal windowbash
gemini --model YOUR_MODEL_ID

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

Text
Reply with one sentence confirming the connection is working.

A normal reply means setup is complete.