본문으로 건너뛰기

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#

  1. Install Antigravity CLI

    Close and reopen your terminal after installing. Skip this if it is already installed.

    macOS · Linux

    Install script.

    curl -fsSL https://antigravity.google/cli/install.sh | bash
    # then open a new terminal
    agy --version
  2. Create 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.

  3. Connect to PleumRouter

    Pick one. A key in an environment variable alone is ignored. settings.json must contain modelProvider.

    pleum launch

    Merges `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 exit
  4. Run it and check

    A reply to one prompt in agy means you are connected.

    Terminal
    cd 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#

SettingNotes
settings.json{ "modelProvider": "gemini" }~/.gemini/antigravity-cli/settings.json. Without it, GEMINI_API_KEY is ignored.
GOOGLE_GEMINI_BASE_URLhttps://apirouter.pleum.aiThe origin without /v1beta. The tool appends /v1beta.
GEMINI_API_KEY$PLEUM_API_KEYYour 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#

FeatureStatusNotes
Streaming (SSE)Yes:streamGenerateContent is returned in alt=sse form.
Function callingYesTool calls are converted in both directions. The model must support tool calls.
:countTokensPartialThe endpoint exists but returns an estimate, not an exact tokenizer count.
Non-Gemini modelsNopleum launch agy --model accepts only verified Gemini models and rejects any other model with an error.

Troubleshooting#

SymptomCause and fix
The key is ignored, or it falls back to Google sign-inCheck 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 setsettings.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 FoundGOOGLE_GEMINI_BASE_URL may end in /v1beta or /v1. Use the bare origin https://apirouter.pleum.ai.
401 UnauthorizedCheck that GEMINI_API_KEY is a plm_ key and that you exported it in the same terminal.
model not foundThe --model ID is not in the catalog. Confirm the exact ID with GET /v1/models.
not recognized as a known modelagy'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 terminalexport 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.