Gemini CLI
Google's official terminal agent. Two environment variables route it through the site's Gemini-compatible endpoint.
Prerequisites
Signed in with balance · key created in the right group (create a key) · model IDs from the models table or
/v1/modelsDownload & install
Requires Node.js 20+: npm install -g @google/gemini-cli, then run gemini.
Setup steps
- 1Create a key in a group that includes Gemini models (see Create a key).
- 2Export
GEMINI_API_KEY=sk-xxxxandGOOGLE_GEMINI_BASE_URL=https://api.daoxe.com(site root, no/v1or/v1beta). - 3Open a new terminal, run
gemini, pick «Use Gemini API key» as the auth method; select a site Gemini model with-m <model-id>.
bash
# ~/.zshrc / ~/.bashrc
export GEMINI_API_KEY="sk-xxxx"
export GOOGLE_GEMINI_BASE_URL="https://api.daoxe.com"
gemini -m 你的Gemini模型IDbash
# 先用 curl 验证 Gemini 兼容端点 / smoke-test the Gemini endpoint first
curl "https://api.daoxe.com/v1beta/models/你的Gemini模型ID:generateContent?key=sk-xxxx" \
-H "Content-Type: application/json" \
-d '{"contents":[{"parts":[{"text":"ping"}]}]}'Choosing models
Only Gemini-family models are served on /v1beta; copy IDs (the gemini-* series) from the recommended models table.
Common pitfalls
- Base must be the site root
https://api.daoxe.com: the CLI appends/v1beta/...itself, so an extra/v1gives 404. - Environment variables only apply to new shells — reopen the terminal before running
gemini. - Gemini models also work through OpenAI-protocol tools (Base
https://api.daoxe.com/v1) — see the protocol checklist.