DocsTool guidesGemini CLI
Gemini CLI
Google’s agent for the terminal. Point it at ACCTOKEN with GOOGLE_GEMINI_BASE_URL and pin a model.
Root URLhttps://intl.acctoken.com+ /v1https://intl.acctoken.com/v1Full paththe whole endpoint, e.g. https://intl.acctoken.com/v1/chat/completions
Before you start
- An ACCTOKEN API key. Create one on API Keys in the console.
- Gemini CLI installed. Run
gemini --versionto check.
01Connection details
- Format
- Gemini generateContent
- Base URL
https://intl.acctoken.comno /v1beta- API key
YOUR_API_KEYasGEMINI_API_KEY- Model
gemini-3.8-flashGemini models only. Pin it; the default picks Google’s own IDs- Set as
GEMINI_API_KEYGOOGLE_GEMINI_BASE_URLGEMINI_MODEL
02Set it up
Pick your shell and replace YOUR_API_KEY with your key.
03Check it works
Run one prompt without opening the interactive view:
OKCommon problems
Gemini CLI is not running in a trusted directory
Without the interactive view, Gemini CLI only runs in folders you trust. Start gemini once in that folder and trust it, or add --skip-trust to the command.
Please set an Auth method in your settings.json or specify … GEMINI_API_KEY
Gemini CLI did not find the key. It reads ~/.gemini/.env only in folders you trust: trust the folder, or set GEMINI_API_KEY in your shell as above.
Gemini CLI asks how you want to sign in
Choose Use Gemini API Key, or set security.auth.selectedType to gemini-api-key in settings.json.
No available channel for model … (distributor)
The model was not pinned, so Gemini CLI asked for one of Google’s own IDs. Set GEMINI_MODEL or model.name.
Invalid token
Check GEMINI_API_KEY. Also remove GOOGLE_API_KEY and Vertex AI variables such as GOOGLE_GENAI_USE_VERTEXAI; they change which key and endpoint are used.
Other models fail in Gemini CLI
Gemini CLI uses the Gemini format, which only Gemini models accept. For other models, use an OpenAI-format tool such as Cline.
Something else? Look up the exact message in Errors.