Skip to main content
Gemini CLI uses Google’s native generateContent protocol. SnapGen exposes that protocol at /v1beta/models/{model}:generateContent and accepts the current GPT text model IDs.

Install and verify

Configure SnapGen

The correct current base URL variable is GOOGLE_GEMINI_BASE_URL. Do not use GEMINI_BASE_URL; Gemini CLI does not read that variable. If your shell already has Google credentials, remove the conflicting values for this session:

Send a request

Run gemini without --prompt to enter interactive mode.

Persist the variables

Add the two exports to your shell profile or a local .env file that is excluded from version control.
Gemini CLI’s native request format was verified against SnapGen with gpt-5.4-mini. The gateway translates the request; the model is not a Google Gemini model despite the client protocol.

Troubleshooting

Run unset GOOGLE_API_KEY before starting the CLI. Gemini CLI otherwise prefers GOOGLE_API_KEY, which may send the wrong credential to SnapGen.
Check that the variable name is exactly GOOGLE_GEMINI_BASE_URL and the value is https://api.snapgen.org without /v1 or /v1beta.
Use an ID returned by GET /v1/models. Do not use a Gemini model name unless it is present in the SnapGen catalog.
SnapGen converts the core content-generation protocol. Google-specific account, grounding, caching, or hosted-tool features may not be available.