Skip to main content

Gemini / Antigravity auth

For Gemini 3.x and Antigravity gateway model IDs, prefer Antigravity OAuth. Plain Gemini CLI ~/.gemini/oauth_creds.json still covers Gemini 2.5 when Antigravity creds aren’t around.

Sync (macOS)

  1. Log in with Antigravity / agy so the keyring item exists (service=gemini, account=antigravity).
  2. From this repo:
scripts/sync-antigravity-auth.sh

That writes ~/.gemini/antigravity_oauth_creds.json (mode 600).

Needs macOS security and a prior Antigravity login. Re-run when 3.x calls start failing auth.

Configuration

SettingEnvFlagDefault
Auth pathGEMINI_AUTH_PATH--gemini-auth-pathAntigravity file if present, else ~/.gemini/oauth_creds.json

Docker

Compose default:

GEMINI_AUTH_PATH=/home/codex/.gemini/antigravity_oauth_creds.json

Host ${HOME}/.gemini is mounted writable so token refresh can update the file.

Kubernetes

Secret key GEMINI_OAUTH_JSON is seeded to /home/codex/.gemini/antigravity_oauth_creds.json in an emptyDir HOME (writable for refresh; re-seed from Secret after pod restart if needed).

Gateway model IDs

These public IDs look like Claude/GPT names but use the Gemini / Antigravity provider (not Claude Code):

  • claude-sonnet-4-6
  • claude-opus-4-6-thinking
  • gpt-oss-120b-medium

They remain available when GATEWAY_PROVIDERS=codex,gemini (Claude Code disabled). Full tables: Model catalog.