Skip to main content
Route Antigravity’s model requests through TrueFoundry AI Gateway using its OpenAI-compatible endpoint. This guide uses tfy-ai-vertex/google-gemini-4-carbon, a Gemini model configured in a TrueFoundry Vertex AI model account. The Antigravity App is the desktop agent workspace. Antigravity IDE is the separate code editor. Both clients and the agy CLI can use the same gateway configuration.

Prerequisites

Configure the gateway

1

Get your gateway details

Open the AI Gateway Playground in TrueFoundry and copy the gateway base URL and model ID from the code snippet. See Find your gateway base URL.
TrueFoundry Playground code snippet showing the gateway base URL and model ID

Copy the gateway base URL and model ID from the Playground code snippet.

You will use these values in the configuration:
2

Save the shared configuration

Create the directory if it does not exist:
Open ~/.gemini/config/config.json in your editor. If the file already exists, add the gateway and models sections below while keeping your other settings.
~/.gemini/config/config.json
Replace {GATEWAY_BASE_URL} and YOUR_TRUEFOUNDRY_API_KEY with your values. If your model ID differs, replace it everywhere in the example.
  • wireProtocol: "openai" sends requests to the gateway’s /v1/chat/completions endpoint. It also works when the model behind the gateway is Gemini.
  • models.list lists the models available in Antigravity’s model picker.
  • models.tiers sends background and subagent model requests to the configured model too. The example uses Carbon for every tier to start with one model.
3

Restart Antigravity

Quit and reopen the App or IDE, or start a new CLI session. You can open the desktop clients normally from Finder or the Dock; no terminal launch or Google sign-in is needed for this gateway setup.
Existing AGY_LLM_GATEWAY_* environment variables can override the user configuration. Update or remove old exports if Antigravity still uses a previous URL, key, or model. On a managed workstation, administrator policy can also take precedence.

Select a model and test the connection

Open a new conversation in Antigravity. Click the model selector below the message box and choose tfy-ai-vertex/google-gemini-4-carbon.
Antigravity App model picker listing tfy-ai-vertex/google-gemini-4-carbon

Select your TrueFoundry model in the Antigravity App.

Send this prompt:
You should receive a Python function and a short usage example.
Antigravity desktop App showing a Python function for removing duplicate list items with Gemini Carbon selected

A successful response using Gemini Carbon through TrueFoundry.

Open Request Traces in TrueFoundry AI Gateway and find the request for tfy-ai-vertex/google-gemini-4-carbon. Confirm that it completed successfully to verify that the request went through your gateway.

Add more models

Register the model in TrueFoundry, then add its full model ID to models.list and restart Antigravity. You can keep the same gateway URL and API key, provided the key has access to the new model. For coding workflows, verify streaming and multi-turn tool calling with each model before rolling it out.

Troubleshooting