# Google Antigravity: Use Your Own Gemini API Key, Models and Local LLMs (What Works)

> Antigravity documents no bring-your-own-key or local model option. See what it does support: built-in models, plan quotas, AI credits, MCP servers and the Gemini API agent.

Source: https://www.epifive.com/blog/google-antigravity-gemini-api-key-custom-model · Published 2026-11-20 · EpiFive

## Key takeaways

- Google's Antigravity plans page lists bring-your-own-key and bring-your-own-endpoint as currently unsupported.
- Antigravity models come from the built-in selector: Gemini models plus partner models, with availability depending on your plan.
- Pro and Ultra users can extend usage with AI credits; Google Workspace plans do not include Antigravity limits.
- MCP servers are the documented way to connect your own tools and data to Antigravity.
- A Gemini API key is used with the Antigravity agent in the Gemini API, which is a preview feature and a different product from the Antigravity app.

Google Antigravity does not let you plug in your own Gemini API key, a custom model or a local LLM. Google's plans page says there is currently no support for bring-your-own-key (BYOK) or bring-your-own-endpoint, and the models page only describes picking from the built-in selector. What you can do is choose a model your plan includes, buy AI credits for overage on Pro and Ultra, connect your own tools through MCP, or call the Antigravity agent from code with a Gemini API key.

## Who this is for and what you will have at the end

This guide is for developers who searched for "Antigravity API key", "custom model" or "local LLM" and want a straight answer before spending time on workarounds. At the end you will know what the documentation says, which of your goals map to a supported feature, and how to set each one up.

Product names, plan contents and model lists change quickly. Everything below reflects Google's pages as read on 2026-11-20.

## What Antigravity supports and what it does not

| Goal | Supported? | What to use instead |
|---|---|---|
| Use your own Gemini API key to run the Antigravity app, IDE or CLI | No (plans page: BYOK not supported) | Sign in with an eligible Google account plan |
| Point Antigravity at your own endpoint for more rate limit | No (BYOE not supported) | AI credits on Pro or Ultra |
| Choose a different model | Yes, from the built-in selector | Models page |
| Use a local model (for example through LM Studio) | Not documented | MCP for local tools; a different tool if a local model is a hard requirement |
| Add your own tools and data | Yes | MCP servers |
| Call the Antigravity agent from your own code with an API key | Yes, in preview | Gemini API managed agents |

The wording that matters comes from the plans page. Under options with "currently no support", Google lists "Bring-your-own-key (BYOK) or bring-your-own-endpoint for additional rate limits." The same list includes organizational tiers through a custom contract. The page also states that Google Workspace plans do not include Antigravity plans or higher rate limits, which surprises many business users.

That sentence is about rate limits, so it does not describe every possible configuration. But the models page does not mention a bring-your-own-model path at all, and we found no Antigravity documentation page that describes a custom or local model setting. Community forum threads ask for the feature. Forum posts and third-party proxies are not documentation, so if you rely on one, you are outside what Google supports and a product update can break it.

## Choosing a model in Antigravity

The models page lists what the selector offers, and availability depends on plan:

- **Gemini 4 family:** Neon, Carbon, Argon and Hydrogen, plus Orchestrator variants that pair a Gemini 4 planner with Hydrogen for execution.
- **Gemini 3 family:** Gemini 3.8 Flash, 3.7 Flash, 3.6 Flash and 3.1 Pro. Only 3.8 Flash is listed for Free and Plus plans.
- **Partner models:** Claude Sonnet 5.5 and Opus 5.5 (thinking), Claude Sonnet 4.6 and Opus 4.6 (thinking), and GPT-OSS-120b. The page says the Claude 4.6 models and GPT-OSS-120b "Will be removed on November 18, 2026", so check the selector in your own install.
- **Image generation:** Nano Banana 2, which the page says is not customizable.

Plan summary from the same page:

| Plan | Models listed |
|---|---|
| Free and Plus | Gemini 3.8 Flash, Claude 4.6 models, GPT-OSS-120b |
| Google AI Pro | Most Gemini 4 models and Orchestrators (Neon and Argon), Gemini 3.8 Flash, Claude 4.6 models |
| Google AI Ultra | All Gemini 4 models and Orchestrators including Carbon, Claude 5.5 models, GPT-OSS-120b |
| Enterprise | Gemini 3.x and Claude 5.5 models; Gemini 4 included, Orchestrators not |

The model selector shows separate weekly and five-hour limits for Gemini models and for Claude and GPT models. The page does not publish numeric limits, and it refers to the plans page for rate-limit detail. Prices are not on either page; Google links to its AI plans page, so check that for current cost.

### How the quotas behave

From the plans page:

- Ultra: "The highest, most generous quota, refreshed every five hours."
- Pro: "A high, generous quota, refreshed every five hours until the weekly limit is reached."
- Other plans: "A meaningful quota, refreshed weekly."
- For all plans, baseline limits are "primarily determined by available capacity and exist to prevent abuse."

Because capacity affects the baseline, two users on the same plan can see different headroom at different times. Plan around that variability rather than a fixed number of requests.

## Get more usage with AI credits instead of an API key

If your real reason for wanting a key is to avoid hitting a limit, the documented route is AI credits. Pro and Ultra users can use purchased AI credits, or any one-time promotional credits, for overage. Credits are consumed at standard Gemini Enterprise consumption pricing.

Once the baseline quota is exhausted, the AI Credit Overages setting decides what happens. Choose "Never" if you want Antigravity to wait until the baseline quota refreshes: the page describes it as never using AI credits automatically. That is the safe setting if you do not want surprise charges. Free and Plus users, and Workspace users, are not listed as eligible for credit overage.

## Connect your own tools and data with MCP

You cannot change the model, but you can extend what the agent can reach. Antigravity documents Model Context Protocol (MCP) servers on each surface.

**Antigravity App:** click **Customizations** in the sidebar, then **Installed**. In the **MCP Servers** section click **Add MCP Server** (+), search for the server and click **Add**.

**Antigravity IDE:** click the three dots at the top of the agent side panel and select **MCP Servers**. Install from the MCP Store, or click **Manage MCP Servers** and then **View raw config**.

**Antigravity CLI:** type `/mcp` in the prompt panel and press Enter to open the MCP Manager Overlay, or edit the file directly.

The config file is `mcp_config.json`, located globally at `~/.gemini/config/mcp_config.json` or per workspace at `<workspace>/.agents/mcp_config.json`. A local stdio server looks like this, as shown in Google's documentation:

```json
{
  "mcpServers": {
    "my-local-server": {
      "command": "node",
      "args": ["/path/to/server.js"],
      "env": {
        "API_KEY_NAME": "value"
      }
    }
  }
}
```

A remote server uses `serverUrl` and optional headers:

```json
{
  "mcpServers": {
    "my-remote-server": {
      "serverUrl": "https://api.example.com/mcp/",
      "headers": {
        "Authorization": "Bearer YOUR_API_TOKEN"
      }
    }
  }
}
```

Rules from the documentation:

- Each entry needs exactly one transport property: `command` for local stdio servers or `serverUrl` for remote ones.
- Remote servers must use the Streamable HTTP transport. The legacy HTTP+SSE transport and the `httpUrl` field are not supported.
- The default connection timeout is 300 seconds and each tool call times out after 180 seconds. `timeoutSeconds` changes this; a negative value disables both limits.
- MCP tools you have not configured run in Ask mode, so you approve each use.

Keep secrets such as bearer tokens out of any workspace file you commit. For a general introduction, see [our MCP server tutorial](https://www.epifive.com/blog/model-context-protocol-mcp-server-python-tutorial) and [the roundup of useful MCP servers](https://www.epifive.com/blog/best-mcp-servers-github-daily-work).

## Use a Gemini API key with the Antigravity agent

A Gemini API key does have a documented place near Antigravity, but it is a different product. The Gemini API documents "managed agents" built on an Antigravity base agent. You call it from code, not from the Antigravity app, and it is authenticated with your API key rather than your Antigravity plan sign-in. Check the Gemini API pricing and limits pages for how that usage is billed. Google states: "Managed agents are in preview. Features and schemas may change."

### Create and store the key

Create a key on the Google AI Studio API keys page using "Create or view a Gemini API Key". The docs say new keys created in AI Studio are authorization keys by default, starting May 28, 2026. On Linux or macOS with Bash, add this line to `~/.bashrc` (use `~/.zshrc` for Zsh) and run `source ~/.bashrc`:

```bash
export GEMINI_API_KEY=[YOUR_API_KEY_HERE]
```

On Windows, search for "Environment Variables", open **Environment Variables** in the System Properties dialog, click **New...** under User variables, enter `GEMINI_API_KEY` as the name and your key as the value, click **OK**, then open a new terminal. If both `GEMINI_API_KEY` and `GOOGLE_API_KEY` are set, the client libraries use `GOOGLE_API_KEY`.

Google's security guidance: treat the key like a password, never check it into source control, never expose it client-side in production, and prefer Secret Manager in production.

### What the managed agents page documents

- Clients use API version `v1beta`, for example `genai.Client(http_options={"api_version": "v1beta"})` in Python.
- An inline run calls `client.interactions.create(` with `agent="antigravity-preview-09-2026"`, a `system_instruction` and an `environment` of type `remote` with `sources`.
- You can register a reusable agent with `client.agents.create(` using `id`, `base_agent`, `agent_config`, `system_instruction` and `base_environment`. The REST endpoint is `https://generativelanguage.googleapis.com/v1beta/agents`, with the key sent in the `x-goog-api-key` header.
- The default model is `gemini-4-hydrogen`, set through `agent_config`. Other listed options are `gemini-4-carbon`, `gemini-4-neon`, `gemini-4-argon`, `gemini-3.8-flash`, `gemini-3.6-flash` and `gemini-3.5-flash-lite`.
- Only `antigravity-preview-09-2026` is accepted as `base_agent`. You can have up to 1000 managed agents, and ids cannot use reserved prefixes such as `gemini-` or `google-`.
- Not yet available: versioning and rollback, and subagent delegation.

Notice that the model choices here are also Google's own Gemini models. This path gives you programmatic control and your own instructions and tools, not a way to bring a non-Google model.

## If you need a local or third-party model

If a local LLM is a requirement, such as for offline work or data that cannot leave your machine, Antigravity is not documented to support it. Your options are to use a different coding tool whose documentation lists custom or local endpoints, or to keep Antigravity for hosted models and expose your local resources to it through an MCP server. Check any tool's own documentation for exactly which endpoint types it accepts before you commit to it.

Be cautious with community proxies that claim to redirect Antigravity. They route your prompts and code through software Google does not document, and they can stop working after any update.

## Troubleshooting

### The model you want is missing from the selector

Check your plan against the models table. Gemini 4 Carbon is listed only for Ultra, and Pro lists Neon and Argon. The Claude 4.6 models and GPT-OSS-120b carry a removal date of November 18, 2026 on the models page.

### Antigravity says you hit a limit

Look at the weekly and five-hour limits in the model selector. Gemini and Claude/GPT limits are separate. If you are on Pro or Ultra, review the AI Credit Overages setting; on other plans the quota refreshes weekly.

### Workspace account has no higher limits

Google states that Workspace plans do not include Antigravity plans or higher rate limits. A personal Google AI plan is a separate subscription.

### An MCP server does not connect

Confirm the entry has exactly one of `command` or `serverUrl`, that remote servers use Streamable HTTP rather than legacy SSE, and that you did not use `httpUrl`. Raise `timeoutSeconds` if a slow server hits the 300 second or 180 second limits.

### The Gemini API call is rejected

Confirm `GEMINI_API_KEY` is set in the shell that runs your code, that no stale `GOOGLE_API_KEY` is overriding it, that the client uses `v1beta`, and that `base_agent` is exactly `antigravity-preview-09-2026`.

## Checklist

- Decide whether you need a model change, more quota, more tools or programmatic access.
- For quota, use plan quotas and AI credits; do not expect BYOK.
- For tools, add an MCP server in `mcp_config.json`.
- For code access, use a Gemini API key with managed agents and accept the preview status.
- Re-check the plans and models pages before relying on any model name, since they change.

## What we checked

- Opened the Antigravity plans page on 2026-11-20. It lists "Bring-your-own-key (BYOK) or bring-your-own-endpoint for additional rate limits" under options with "currently no support", and says Workspace plans do not include Antigravity plans or higher rate limits.
- Opened the Antigravity models page on 2026-11-20 and found no mention of bring-your-own-key or local models. Cross-checked against the plans page for plan quotas and credits.
- Opened the Antigravity MCP page on 2026-11-20 and copied the two JSON examples, the config file paths and the timeout defaults (300 seconds and 180 seconds) from it.
- Opened the Gemini API managed agents page and the API key page on 2026-11-20 and compared the model identifiers and the `antigravity-preview-09-2026` base agent name with the Antigravity models page; the Gemini model families agree.
- Documented output: none of these pages shows terminal output for the steps above, so none is reproduced here.
- Not checked: we did not run Antigravity, call the Gemini API, or test any community proxy or local model setup. Steps follow Google's documentation as of 2026-11-20, and prices and numeric limits were not published on the pages we opened.

Last tested: 2026-11-20

## References

- Antigravity plans: https://antigravity.google/docs/plans
- Antigravity models: https://antigravity.google/docs/models
- Antigravity MCP: https://antigravity.google/docs/mcp
- Gemini API managed agents: https://aistudio.google.com/docs/custom-agents
- Gemini API keys: https://aistudio.google.com/docs/api-key

## Frequently asked questions

### Can I use my own Gemini API key in Google Antigravity?

Not to power the Antigravity app, IDE or CLI. Google's Antigravity plans page says there is currently no support for bring-your-own-key (BYOK) or bring-your-own-endpoint for additional rate limits. Antigravity access comes from your Google account plan. A Gemini API key does work with the separate Antigravity agent in the Gemini API.

### Can Google Antigravity use a local model such as one served by LM Studio?

The Antigravity documentation pages we opened do not describe connecting a local or custom model; the model selector lists Google and partner models only. Anything that redirects Antigravity to another endpoint is outside the documented product, so treat it as unsupported.

### How do I get more Antigravity usage than my plan allows?

Google AI Pro and Ultra users can use purchased AI credits for overage once the baseline quota is used up, controlled by the AI Credit Overages setting. Credits are consumed at standard Gemini Enterprise consumption pricing, and Google Workspace plans do not include higher Antigravity limits.

### How do I add tools or my own data to Antigravity?

Add an MCP server. In the CLI and IDE, MCP servers are defined in mcp_config.json, either globally at ~/.gemini/config/mcp_config.json or per workspace at .agents/mcp_config.json. Each entry uses command for a local stdio server or serverUrl for a remote Streamable HTTP server.

