Quick Agent Access
Gemini CLI
Configuration steps
- Confirm that the account and API Key can use the public Gemini model. The administrator must also price the model and map it to a Gemini channel.
- Set these variables in the same terminal that starts Gemini CLI:
$env:GEMINI_API_KEY = "YOUR_API_KEY"
$env:GOOGLE_GEMINI_BASE_URL = "https://www.zltokens.com"
$env:GEMINI_MODEL = "PUBLIC_GEMINI_MODEL"
gemini- Set
GOOGLE_GEMINI_BASE_URLto the server root only. Gemini CLI calls the platform/v1beta/models/...route; do not put/v1in this variable. - Start with a short request and verify the model name, Gemini route, tokens, and deduction in usage logs.
When not to use this path
- Gemini CLI is not a general OpenAI-compatible client.
- If the current version does not support
GOOGLE_GEMINI_BASE_URL, the request does not reach platform logs, or it returns official Gemini authentication errors, use Cline, Cherry Studio, or Codex with the OpenAI Compatible setup.
Verification and limits
- Use
GEMINI_API_KEYand a customGOOGLE_GEMINI_BASE_URLonly withgemini-api-keyauthentication, not Google Sign-In, Code Assist, or Vertex AI. - The URL must be an HTTPS root without
/v1. A successful request should show/v1beta/modelsin usage logs; otherwise use a verified OpenAI-compatible client.
Official version reference
- Client configuration can change by version. Before deployment, troubleshooting, or a configuration change, check [Gemini CLI configuration reference](https://github.com/google-gemini/gemini-cli/blob/main/docs/reference/configuration.md).