Antigravity CLI
Connect Google Antigravity CLI (agy) to HopBase's native Gemini API with a Gemini API key and a custom base URL.
Antigravity CLI (command agy) is Google's terminal coding agent. It can sign in with a Gemini API key and override the base URL, and it speaks the native Gemini protocol, so pointing the base URL at HopBase is all it takes. No translation layer is involved.
| Setting | Value |
|---|---|
modelProvider (settings.json) | gemini |
GEMINI_API_KEY | A key created in the console |
GOOGLE_GEMINI_BASE_URL | https://api.hop-base.com |
| Endpoint it calls | POST /v1beta/models/{model}:streamGenerateContent?alt=sse |
Tested in production with agy 1.5.12: reading, writing, and editing files, running shell commands, parallel and sequential tool calls, resuming with --continue, long context, image input, and a full coding task (create a project, write code, run the tests) all work.
Select Gemini Official Direct (Enterprise) when you create the key. Both the model you pick in agy and the helper models it calls in the background are in this group; a key without it gets 404.
Configure Antigravity CLI
Install
On macOS, install with Homebrew:
brew install --cask antigravity-cli
agy --versionOn other systems, follow the official Antigravity CLI page. API-key sign-in with a custom base URL needs version 1.1.13 or later.
Switch sign-in to a Gemini API key
Edit ~/.gemini/antigravity-cli/settings.json in your home directory (create it if it does not exist):
{
"modelProvider": "gemini"
}The value must be lowercase gemini. If you only set the environment variables and skip this, agy still signs in with a Google account.
Set the key and base URL
export GEMINI_API_KEY=sk-your-key
export GOOGLE_GEMINI_BASE_URL=https://api.hop-base.comTo keep them, add both lines to ~/.zshrc or ~/.bashrc.
Set GOOGLE_GEMINI_BASE_URL to the root URL only, without a path such as /v1beta. agy reads environment variables from the terminal that starts it; it does not read .env files or GOOGLE_API_KEY.
Start and pick a model
agy --model gemini-4-argon-medium
# or run a single prompt
agy -p "Explain this repository" --model gemini-4-hydrogen-lowChoose a model
An agy model name is a HopBase model ID plus a thinking-level suffix. The suffix sets thinkingLevel in the request: higher levels think longer and use more tokens. agy models prints agy's built-in list; use this table instead:
| HopBase model | Suffixes | Example |
|---|---|---|
gemini-4-argon | -low / -medium / -high | agy --model gemini-4-argon-medium |
gemini-4-carbon | -low / -medium / -high | agy --model gemini-4-carbon-high |
gemini-4-hydrogen | -low / -medium / -high | agy --model gemini-4-hydrogen-low |
gemini-4-neon | -low / -medium / -high | agy --model gemini-4-neon-medium |
gemini-3.8-flash | -low / -medium / -high | agy --model gemini-3.8-flash-medium |
See Models for prices.
After each step, agy runs a safety review with gemini-3.1-flash-lite-preview or gemini-3.8-flash. These requests are billed too and appear in the console usage log.
Known limitations
- Whole-response output: responses are not streamed token by token; each answer arrives in one piece when generation finishes. With long answers or high thinking levels, agy waits for a while and then shows the full reply. It is not stuck.
- The
-xhighlevel is not supported yet: use-highinstead of an-xhighmodel from agy's list. - Interrupted requests are still billed: if you press Ctrl+C, the request already sent finishes on the server and is billed.
Next steps
- Gemini chat: use the same Gemini models from your own code
- Error codes and retries: handle 429, 502, and 503
- Troubleshooting: look up an error message