Core AI Coding Tools
Gemini CLI
Google’s official terminal agent, pointed at the gateway via environment variables.
1Install
Requires Node.js 20 or later.
npm install -g @google/gemini-cli
gemini --version2Configure access
YOUR_API_KEY in the examples is a placeholder and will not work as copied. Sign in to pick one of your keys and fill it into every example on this page.
Sign in to fill in keyGemini CLI uses two environment variables to connect to the gateway. Save them in its own .env file to load them on startup. Replace YOUR_API_KEY with your API key, or choose a key at the top of the page to fill it in automatically.
GEMINI_API_KEY=YOUR_API_KEY
GOOGLE_GEMINI_BASE_URL=https://api.keyvia.ccmkdir -p ~/.gemini && cat <<'EOF' > ~/.gemini/.env
GEMINI_API_KEY=YOUR_API_KEY
GOOGLE_GEMINI_BASE_URL=https://api.keyvia.cc
EOFGOOGLE_GEMINI_BASE_URL must be the root URL without /v1 or /v1beta; the CLI appends the path. The key’s group must support Gemini.
3Verify
Open your project directory and run gemini. At the initial authentication prompt, choose “Use Gemini API Key”. A successful reply confirms the connection.
- For 401 / 403 / 429 errors, see Error codes.