Skip to main content
Gemini CLI uses Google’s native generateContent protocol. FreeModel serves that protocol at /v1beta/models/{model}:generateContent for its Gemini models: gemini-3.8-flash, gemini-3.6-flash, gemini-3.5-flash, and gemini-3.1-pro-preview.

Install and verify

Configure FreeModel

The base URL variable is GOOGLE_GEMINI_BASE_URL. Gemini CLI does not read GEMINI_BASE_URL. 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.
Only Gemini model IDs are served on the native protocol. GPT-5, Grok, and DeepSeek models use Chat Completions instead, and FreeModel does not translate between protocols.

Troubleshooting

Run unset GOOGLE_API_KEY before starting the CLI. Gemini CLI otherwise prefers GOOGLE_API_KEY, which may send the wrong credential to FreeModel.
Check that the variable name is exactly GOOGLE_GEMINI_BASE_URL and the value is https://api.freemodel.app without /v1 or /v1beta.
Use a Gemini ID returned by GET /v1/models. A 404 model_not_available for a GPT or DeepSeek ID means that model is not served on the native protocol.
FreeModel forwards the content-generation protocol. Google account features such as grounding, context caching management, and hosted tools may be unavailable.