Skip to main content
Gemini CLI is Google’s terminal coding agent. Bifrost exposes the GenAI-compatible endpoint it uses in API-key mode.

Install Gemini CLI

Authentication requirement

Gemini CLI currently requires a Bifrost virtual key when gateway inference authentication is enabled. An Enterprise browser SSO session by itself is not enough for this harness.
Gemini CLI sends its API-key credential as x-goog-api-key. Bifrost Enterprise agent sessions use Authorization: Bearer <agent-token>. Bifrost CLI therefore does not pass an SSO agent token directly to Gemini, because it would travel in the wrong credential field. Google account OAuth, Google Cloud ADC, Vertex service accounts, and Bifrost agent tokens are different authentication systems. Logging Gemini CLI into a Google account does not authenticate the process to Bifrost.
A new virtual key with no provider_configs denies all providers by default. Make sure gemini/gemini-2.5-pro (or the model you choose) appears in bifrost models list before launching, or the request is rejected.
If you are also signed in through bifrost auth login, keep the virtual key configured for Gemini. Bifrost CLI uses the virtual key for this harness even though Claude Code, Codex, and OpenCode can use the SSO agent token.

Configure Gemini CLI manually

Select Use Gemini API Key in Gemini CLI and set:
For a remote gateway, use its HTTPS URL:
GOOGLE_GEMINI_BASE_URL applies to Gemini API-key authentication. The Google OAuth and Vertex AI modes have different transports and credentials and are not the supported route for authenticating to Bifrost’s /genai endpoint.

Use a non-Google model

Bifrost can translate GenAI requests to another configured provider. Supply the full Bifrost model identifier:
The selected model must support the function calls and streaming behavior Gemini CLI needs for file access, shell commands, and edits. A model being listed by /v1/models does not guarantee full coding-agent compatibility.

Troubleshooting

Bifrost says Gemini cannot use Enterprise SSO directly

Configure a virtual key:
Then relaunch Gemini.

Gemini asks for an API key

Confirm that GEMINI_API_KEY is present for a manual launch, or that bifrost auth status reports has_virtual_key: true when launching through Bifrost CLI.

Requests go to Google instead of Bifrost

Select Use Gemini API Key, not Google account or Vertex authentication, and verify GOOGLE_GEMINI_BASE_URL ends in /genai.

Next steps