Antigravity CLI
Connect Google's terminal coding agent, Antigravity CLI (`agy`), to PleumRouter.
Antigravity CLI is a terminal program, not the desktop IDE, and its command is agy. It talks the Gemini API format (generateContent) and lets you point GOOGLE_GEMINI_BASE_URL at another endpoint, so it connects to PleumRouter's Gemini-compatible endpoint. If you use Google's Gemini CLI, see Gemini CLI.
Quick start#
Install Antigravity CLI
Close and reopen your terminal after installing. Skip this if it is already installed.
macOS · LinuxInstall script.
curl -fsSL https://antigravity.google/cli/install.sh | bash # then open a new terminal agy --versionPowerShell.
irm https://antigravity.google/cli/install.ps1 | iex # then open a new terminal agy --versionCreate an API key
In the dashboard's API keys page, create a key that starts with
plm_and copy it. Set daily, weekly or monthly budgets on it while you are there.Connect to PleumRouter
Pick one. A key in an environment variable alone is ignored.
settings.jsonmust containmodelProvider.pleum launchMerges `modelProvider` into `~/.gemini/antigravity-cli/settings.json` (and `model` if you pass `--model`), and attaches the address and key for this run only. Your original values are restored when it exits.
npm i -g pleumrouter pleum login # sign in with the browser pleum launch agy # merges modelProvider into settings.json (and model with --model), restores it on exitCreate the settings file if it is missing (if it exists, add only the `modelProvider` key), `export` the values, then run. In a new terminal you must `export` again.
# settings.json: create it if missing; if it already exists, add only "modelProvider": "gemini" and keep the rest mkdir -p ~/.gemini/antigravity-cli [ -f ~/.gemini/antigravity-cli/settings.json ] || echo '{ "modelProvider": "gemini" }' > ~/.gemini/antigravity-cli/settings.json export PLEUM_API_KEY="plm_xxxxxxxxxxxxxxxx" # GOOGLE_GEMINI_BASE_URL is the origin WITHOUT /v1beta — agy appends /v1beta itself. export GEMINI_API_KEY="$PLEUM_API_KEY" export GOOGLE_GEMINI_BASE_URL="https://apirouter.pleum.ai" # to keep them, add these export lines to ~/.zshrc or ~/.bashrc agy --model gemini-3.8-flash --effort lowPowerShell commands.
New-Item -ItemType Directory -Force -Path "$HOME\.gemini\antigravity-cli" | Out-Null # settings.json: create it if missing; if it already exists, add only "modelProvider": "gemini" and keep the rest $settings = "$HOME\.gemini\antigravity-cli\settings.json" if (-not (Test-Path $settings)) { Set-Content -Path $settings -Value '{ "modelProvider": "gemini" }' } $env:PLEUM_API_KEY = "plm_xxxxxxxxxxxxxxxx" $env:GEMINI_API_KEY = $env:PLEUM_API_KEY $env:GOOGLE_GEMINI_BASE_URL = "https://apirouter.pleum.ai" # to keep them for new terminals: setx GEMINI_API_KEY $env:PLEUM_API_KEY and setx GOOGLE_GEMINI_BASE_URL "https://apirouter.pleum.ai" agy --model gemini-3.8-flash --effort lowRun it and check
A reply to one prompt in
agymeans you are connected.Terminalcd your-project agy
Why use PleumRouter with Antigravity CLI?#
- Pay only for what you use from prepaid credits. Credits are deducted separately from the tool maker's subscription.
- Set budgets and limits per key. Daily, weekly and monthly budgets, model allow-lists and team budgets help you manage what an agent spends.
- One key, many models. Pick Claude, GPT, Gemini or open models; automatic retries and fallback cover provider outages; usage shows up in the dashboard.
How it works#
Antigravity CLI sends Gemini API requests (POST /v1beta/models/{model}:generateContent, or :streamGenerateContent for streaming) to the server GOOGLE_GEMINI_BASE_URL points at, appending /v1beta itself. PleumRouter accepts the Gemini-format request, converts function calling and streaming (SSE), forwards it to the provider of the model you chose, and returns a Gemini-format response. Auth is the plm_ key in GEMINI_API_KEY.
Configuration reference#
| Setting | Notes |
|---|---|
| settings.json{ "modelProvider": "gemini" } | ~/.gemini/antigravity-cli/settings.json. Without it, GEMINI_API_KEY is ignored. |
| GOOGLE_GEMINI_BASE_URLhttps://apirouter.pleum.ai | The origin without /v1beta. The tool appends /v1beta. |
| GEMINI_API_KEY$PLEUM_API_KEY | Your PleumRouter API key. |
| --model / --effortgemini-3.8-flash / low | --model accepts only the Gemini models agy knows. --effort is optional; see agy --help for its values. |
Choosing models#
Use Gemini model IDs with agy. --model accepts only the Gemini models agy knows (for example gemini-3.8-flash), and pleum launch agy --model accepts only verified Gemini models. Look up exact IDs in the model catalog or with GET /v1/models.
These steps assume Gemini models. Tool-calling quality can vary by model.
Compatibility#
| Feature | Status | Notes |
|---|---|---|
| Streaming (SSE) | Yes | :streamGenerateContent is returned in alt=sse form. |
| Function calling | Yes | Tool calls are converted in both directions. The model must support tool calls. |
:countTokens | Partial | The endpoint exists but returns an estimate, not an exact tokenizer count. |
| Non-Gemini models | No | pleum launch agy --model accepts only verified Gemini models and rejects any other model with an error. |
Troubleshooting#
| Symptom | Cause and fix |
|---|---|
| The key is ignored, or it falls back to Google sign-in | Check that ~/.gemini/antigravity-cli/settings.json contains { "modelProvider": "gemini" }. Without that file, GEMINI_API_KEY is not used. |
modelProvider is set to … environment variable is not set | settings.json contains modelProvider, but GEMINI_API_KEY is not set in this terminal. export the key, or remove modelProvider from settings.json. To apply it to one run without editing the file, run agy --settings '{"modelProvider":"gemini"}' after you export the variables. |
| 404 Not Found | GOOGLE_GEMINI_BASE_URL may end in /v1beta or /v1. Use the bare origin https://apirouter.pleum.ai. |
| 401 Unauthorized | Check that GEMINI_API_KEY is a plm_ key and that you exported it in the same terminal. |
| model not found | The --model ID is not in the catalog. Confirm the exact ID with GET /v1/models. |
not recognized as a known model | agy's --model accepts only the Gemini models it knows. Run agy models to see the IDs you can use. |
| It stopped working in a new terminal | export lasts only in that terminal. Redo it each time or put it in your shell profile; the easy route is pleum launch agy. |
Did pleum launch agy change my settings? | While it runs, it changes only modelProvider in settings.json (and model if you pass --model) and leaves the rest. When agy exits, your original values are restored automatically; a change left by an abnormal exit is restored the next time you run pleum. |
Cost & security tips#
- Set a budget on the key. A coding agent calls the model many times per task and resends long context. Daily, weekly or monthly budgets on your API key make costs easier to predict.
- Keep the key out of git. Make sure a key in your shell profile or config file never gets committed, and if you suspect a leak, revoke it in the dashboard and issue a new one.
- Check where sensitive code goes. Prompts and code are sent to the provider of the model you pick. Use Data residency and PII masking to control that.