APIMaster.ai

Gemini CLI setup

Configure Gemini CLI when Gemini models are enabled on your account.

Gemini CLI setup

Prerequisites: Environment check.

The marketplace currently highlights Claude and GPT. Use Gemini CLI only if GET https://apimaster.ai/v1/models lists Gemini ids for your account. Otherwise use Claude Code or Codex, or Contact us.


Windows

Win + R%userprofile%\.gemini

Create .env:

GOOGLE_GEMINI_BASE_URL=https://apimaster.ai
GEMINI_API_KEY=YOUR_API_KEY
GEMINI_MODEL=gemini-2.5-pro

Adjust GEMINI_MODEL to an id your account supports. Variable names may differ by CLI version (GOOGLE_API_KEY etc.).

Test: gemini


macOS

~/.gemini — same .env. Test: gemini


Troubleshooting

Issue Fix
Unknown model Confirm Gemini is enabled upstream
401 Key and base URL
Mixed tools Each CLI has its own config directory