Antigravity CLI (agy) with a custom Gemini endpoint
I run qcode.cc, an independent API service (not official Anthropic, OpenAI or Google). The examples use QCode paths; swap the host for any compatible gateway.
What agy accepts
- Custom endpoints speak the Gemini native protocol only. The
modelProviderfield accepts just"gemini", so agy cannot be pointed at OpenAI-compatible or Anthropic endpoints. - The credential comes from the
GEMINI_API_KEYenvironment variable.GOOGLE_API_KEYis ignored and agy does not load.envfiles. - The desktop Antigravity IDE (2.0) has no custom-provider setting. Only the CLI works with a custom endpoint.
Config
Base URL without /v1beta (the client appends it):
export GOOGLE_GEMINI_BASE_URL="https://api.qcode.cc/gemini"
export GEMINI_API_KEY="cr_your_key"
~/.gemini/antigravity-cli/settings.json (Windows: %USERPROFILE%\.gemini\antigravity-cli\settings.json):
{
"modelProvider": "gemini",
"model": "Gemini 4 Neon (High)"
}
Use the display name exactly. Gemini 4 Neon (Medium), (XHigh) and (Low) also work; they map to /gemini/v1beta/models/gemini-4-neon:streamGenerateContent.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
| 404 on the first request | model missing, or the raw id gemini-4-neon used. agy falls back to a default Gemini preview model that the endpoint does not serve. | Set "model": "Gemini 4 Neon (High)" together with "modelProvider": "gemini". |
404 with /v1beta/v1beta in the URL | /v1beta was put on the Base URL. | End the Base URL at /gemini. |
| 401 | Key not read. | Export GEMINI_API_KEY (not GOOGLE_API_KEY) and open a new terminal. |
| Want Claude or GPT in agy | Not possible through agy's custom endpoint. | Use Claude Code for Claude and Codex CLI for GPT; the same cr_ key works on their paths. |
One-command setup for agy, Claude Code and Codex: one-click install. Full page: docs.qcode.cc Antigravity CLI. Gemini CLI personal and Pro login plans stopped on 2026-06-18 (Google's announcement); an API-key setup like the one above is unaffected. More: Gemini setup overview.
Facts checked against docs.qcode.cc on 2026-12-05. I run qcode.cc. Pricing: qcode.cc/pricing (no free quota). Contact: hi@qcode.cc.