Use this guide to run Gemini CLI with CometAPI as the API endpoint. Official references:Documentation Index
Fetch the complete documentation index at: https://apidoc.cometapi.com/llms.txt
Use this file to discover all available pages before exploring further.
Model availability changes over time. Check the CometAPI Models page
for available Gemini models.
Prerequisites
| Requirement | Details |
|---|---|
| Node.js | 22+ (LTS recommended) |
| OS | macOS, Linux, or Windows |
| CometAPI key | From your CometAPI Dashboard (starts with sk-) |
Setup
Persist environment variables
To avoid re-exporting every session, add to your shell config:Troubleshooting
| Symptom | Fix |
|---|---|
Invalid API Key error | Verify GEMINI_API_KEY is set correctly. Run echo $GEMINI_API_KEY to check |
fetch failed | Network restrictions may block the connection. Try a system-wide proxy |
| Wrong Node.js version | Gemini CLI requires Node.js 22+. Run node --version to check |
| Uninstall | npm uninstall -g @google/gemini-cli |