Configure a gateway for Gemini CLI
Plan a native Gemini gateway root and an isolated API-key session.
Confirm a native Gemini interface first
Website under maintenance. This guide describes planned configuration only: api.ubtl.net is a planned domain, no real API test has been performed, and Gemini CLI connectivity is unverified. Confirm the native Gemini protocol, actual paths, authentication requirements, and model identifiers before use.
These examples use GOOGLE_GEMINI_BASE_URL and GEMINI_API_KEY and require a native Gemini gateway, not an OpenAI chat request URL. Exit the tool, back up any existing settings you intend to modify, and inspect the currently selected authentication mode. Gateway detection and authentication prompts can vary by CLI version; follow the behavior documented for your installed version rather than assuming every screen is identical.
Configure session-scoped environment variables
Use the planned root https://api.ubtl.net for GOOGLE_GEMINI_BASE_URL; the SDK constructs provider request paths. Do not append /v1, /v1beta, or /v1/chat/completions by guesswork. Choose the Bash or PowerShell example for your shell, verify that the installed CLI recognizes the variables, and launch the tool from that same terminal.
The key shown is only a placeholder. Later, use a separate revocable API key, avoid overwriting credentials for other Gemini projects, and protect shell history and backups. If the installed version requests an authentication choice, follow its documented Gemini API-key mode. A successful Google OAuth login does not validate this custom gateway, and unrelated Claude or Codex credentials should not be mixed into the setup.
export GOOGLE_GEMINI_BASE_URL='https://api.ubtl.net'
export GEMINI_API_KEY='YOUR_UBTL_API_KEY'
gemini$env:GOOGLE_GEMINI_BASE_URL = 'https://api.ubtl.net'
$env:GEMINI_API_KEY = 'YOUR_UBTL_API_KEY'
geminiRestart and inspect the model and path
After restarting, first inspect whether the intended settings were loaded. A new terminal needs the same variables loaded again. Only after service availability is confirmed should you replace YOUR_MODEL_ID through the installed version's supported model-selection workflow and send a short non-sensitive prompt. For authentication errors, inspect the API key and selected mode; for path errors, inspect the root URL and SDK version; for model errors, inspect permissions. Keep keys out of reports. Remove the added variables and restore backed-up settings when reverting.