AnyRouter

Antigravity (Google) (BYOK)

How to create an API key for Antigravity (Google) and add it to AnyRouter via Bring Your Own Key.

Antigravity is Google's agentic IDE. It has no API-key console and no developer settings page — there is nothing to sign up for and nothing to copy. The credential it authenticates with lives on the machine where Antigravity is installed, so the anyr byok CLI finds it for you, shows you exactly what it found, and uploads it as a BYOK key when you say so.

Get your API key

  1. On the machine where Antigravity is installed, run anyr byok locate antigravity to see what the CLI can find. It is read-only and shows a masked preview.
  2. Run anyr byok add antigravity to review the credential and a plain description of what will happen — nothing is uploaded until you pass --yes.
  3. Prefer uploading the full oauth_creds.json composite (access + refresh) so the Antigravity proxy can renew server-side; access-only keys still use anyr byok rotate antigravity.
  4. Donating the key to the shared pool is a separate, explicit opt-in (--donate --donate-yes, or the toggle in the dashboard) — it never happens as a side effect of adding the key.

Gotchas

Antigravity's credential is a short-lived OAuth access token. Prefer uploading the full oauth_creds.json composite (access + refresh) via anyr byok add antigravity so anyrouter-antigravity-proxy can renew the access token server-side (#4212). Access-only keys still expire in about an hour — run anyr byok rotate antigravity on the machine that holds the refresh grant (--dry-run / --watch 15m supported). Rotate never contacts Google and never sends the refresh token; a rejected upload leaves the previous credential in place.

Where the credential comes from

Antigravity does not hand out API keys. When you sign in, its CLI stores a token in your operating system's secure keyring — Apple Keychain on macOS, Secret Service on Linux.

anyr byok locate antigravity reads that keyring first (macOS via security, Linux via secret-tool; other platforms skip straight to the file scan), then falls back to scanning the usual per-OS config folders for installs that do write credential files. Each candidate is reported with where it came from (keyring or file: …) so you can tell which one is live.

The command is strictly read-only:

  • It never writes to or changes your keyring or config files.
  • It makes no network calls.
  • It prints only a masked preview — the last four characters — never the full token.
  • It never waits on a system pop-up. If your keyring is locked, or the platform has no supported backend, it says so and moves on to the file scan.

Not finding anything is a normal outcome, not an error.

Add the key

Review first, with no flags:

anyr byok add antigravity

That is a dry run. It shows the source, the masked preview, and a plain description of exactly what will happen — the value gets encrypted and stored under an Antigravity (Google) key, your own future requests route through it, billed against your own Google quota. Nothing is sent anywhere.

When you are sure, confirm it:

anyr byok add antigravity --yes

AnyRouter runs a live validation call before storing the key. If it fails, you get the upstream error and the key is not saved.

If an Antigravity key already exists, the command stops and tells you rather than silently replacing it. To deliberately put a new value on an existing key, pass --replace; the key keeps its ID, label, priority, and pool-donation state.

Troubleshooting

What you seeWhat it meansWhat to do
A message about a locked keyring, or no keyring backendYour operating system's secure store is not readable right now — locked, or a headless session with no unlock prompt.Unlock your keyring and run anyr byok locate antigravity again. It falls back to scanning config folders, so you can also just add the key from the dashboard.
Nothing foundThe credential is in the keyring and not in the scanned folders — usually because Antigravity has never been signed in on this machine, or this install keeps its state somewhere else.Open Antigravity and sign in once so it mints a token, then run anyr byok locate antigravity again.
Requests start failing after an hour or so of working fineThe stored copy is a short-lived access token and it has expired.Run anyr byok rotate antigravity to replace the stored value in place.
401 right after adding the keyThe value that was picked up was already stale, or it was not the live credential.Sign in to Antigravity so it mints a fresh token, then run anyr byok rotate antigravity.

Add it to AnyRouter

  1. Go to Dashboard → BYOK.
  2. Find Antigravity (Google) under Available and click Add key.
  3. Paste your key into the API key field.
  4. Click Save. AnyRouter runs a live validation call against Antigravity (Google) before storing the key — if it fails, the dialog shows the upstream error and the key isn't saved.