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
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
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
Gemini CLI says both GOOGLE_API_KEY and GEMINI_API_KEY are set
Gemini CLI says both GOOGLE_API_KEY and GEMINI_API_KEY are set
Run
unset GOOGLE_API_KEY before starting the CLI. Gemini CLI otherwise
prefers GOOGLE_API_KEY, which may send the wrong credential to FreeModel.Requests still go to Google's API
Requests still go to Google's API
Check that the variable name is exactly
GOOGLE_GEMINI_BASE_URL and the
value is https://api.freemodel.app without /v1 or /v1beta.The model is rejected
The model is rejected
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.