AI client connections

OPENCODE · SETUP GUIDE

Connect OpenCode to Antigravity Manager

Connect OpenCode to Manager’s API proxy with a dedicated provider and your gateway key. Use Sync Config Now for a local installation, or add the provider manually on the computer running OpenCode. Then select a model and try a reply and a file read.

Antigravity Tools 5.0.0 · OpenCode 1.x · Updated

Which connection should you use?

To send OpenCode requests through Manager, choose the antigravity-manager provider. Manager handles the upstream accounts; OpenCode connects with the API key from Manager’s API Proxy page.

ConnectionWhat you configureWhen to use it
Manager providerManager’s address, gateway key and a model under antigravity-manager/….You want requests to use Manager’s account pool and routing. Keep the proxy running.
opencode-antigravity-authThe plugin’s OAuth login, Google provider and account pool.You want the plugin to manage the connection directly. Follow the plugin instructions for your OpenCode version.

The Manager route works without installing the OAuth plugin. If you already use the plugin, leave its settings in place and select the full antigravity-manager/MODEL_ID reference when using the gateway. You can switch back to the plugin’s own provider and model afterward.

I already use the auth plugin with OpenCode 2.x

The plugin’s OpenCode 2.x migration guide uses plugins, providers and a different variant format. Keep that configuration separate from the OpenCode 1.x examples below. Save your existing settings and check the client’s supported provider schema before connecting Manager.

1. Prepare OpenCode and save your settings

Start Manager’s proxy, confirm a working model, and back up OpenCode’s current configuration before syncing. The proxy setup guide covers starting the service, finding the key and sending the first API request.

  1. Run opencode --version in the terminal where you will use the client. If the command fails, finish the OpenCode installation first.
  2. Close running OpenCode sessions. Open ~/.config/opencode/ on macOS or Linux, or C:\Users\<User>\.config\opencode\ on Windows.
  3. Save a dated copy of each existing opencode.json and opencode.jsonc. If you use the auth plugin, also save its configuration and antigravity-accounts.json privately.
  4. Note your current provider/model and any custom config location. Keep the copies outside your project repository: settings and account files can contain credentials.

Manager prefers an existing opencode.jsonc in that directory; otherwise it writes opencode.json. Sync accepts JSONC comments and trailing commas, then saves formatted JSON. Your dated copy keeps the original comments and formatting.

My config uses a custom path, project folder or Docker

Manager writes to the home directory of the user running its backend. For a remote server or container, configure OpenCode on the client’s machine using the manual example. See where client sync writes files for the local and server cases.

OpenCode combines global, custom and project configuration. Check OPENCODE_CONFIG, OPENCODE_CONFIG_DIR, OPENCODE_CONFIG_CONTENT, XDG_CONFIG_HOME and any project settings if a change fails to appear. The config locations documentation explains their precedence.

2. Sync the provider from Manager

Open API Proxy → One-Click Agent Tools Configuration and find the OpenCode card. Sync adds Manager’s provider while keeping the other providers in your config.

  1. Leave Sync accounts to antigravity-accounts.json unchecked for this gateway connection.
  2. Click Sync Config Now. In Select OpenCode Models, select a text model that already works through your proxy.
  3. Check Custom Manager BaseURL. For OpenCode and Manager on the same computer, use http://127.0.0.1:8045/v1, adjusting the port to match your proxy. For another host or container, enter the address reachable from OpenCode.
  4. Click Confirm Sync, then use View Config to inspect the saved settings. Compare them with your dated copy before restarting OpenCode.

OpenCode’s @ai-sdk/anthropic adapter uses a base URL ending in /v1. Keep that suffix once, without appending /messages. The separate Claude Code setup uses the proxy’s root address.

What does “Sync accounts” export?

It writes eligible Manager accounts to antigravity-accounts.json in the plugin’s v3 account format, including OAuth refresh tokens. Enable it only when you intend to import accounts into a compatible auth-plugin setup. A gateway connection needs only the proxy key. Existing account files get an automatic backup when no backup already exists; keep your dated copy too.

If account export fails after the provider has been saved, inspect both files before retrying: the provider change can already be in place.

Configure the provider manually

Add the following provider on the computer running OpenCode when you use a custom config path or a remote Manager. Inside an existing file, merge antigravity-manager into its provider object and keep your other settings.

Replace MODEL_ID with the exact model ID you used for a successful proxy request. Set baseURL to the address OpenCode can reach, with /v1 at the end. The model selection guide explains IDs, account access and routing.

OpenCode 1.x · JSON configuration
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "antigravity-manager": {
      "npm": "@ai-sdk/anthropic",
      "name": "Antigravity Manager",
      "options": {
        "baseURL": "http://127.0.0.1:8045/v1",
        "apiKey": "{env:AG_OPENCODE_GATEWAY_KEY}"
      },
      "models": {
        "MODEL_ID": { "name": "Gateway model" }
      }
    }
  }
}

The {env:AG_OPENCODE_GATEWAY_KEY} value loads your key from the terminal environment. Choose your shell below, run the snippet, and paste the API Proxy key at the hidden prompt. Run subsequent OpenCode commands in that same terminal. Close it when finished.

Bash on macOS, Linux or WSL
Bash · enter the gateway key
read -r -s -p 'Manager API key: ' AG_OPENCODE_GATEWAY_KEY
printf '
'
export AG_OPENCODE_GATEWAY_KEY
PowerShell on Windows
PowerShell · enter the gateway key
$env:AG_OPENCODE_GATEWAY_KEY = [System.Net.NetworkCredential]::new(
  '', (Read-Host 'Manager API key' -AsSecureString)
).Password

This example supplies a basic model entry for the first connection. Sync Config Now also supplies known models’ limits, input types and reasoning variants. Keep those generated fields when moving a synced provider to another machine. Manager’s sync writes the gateway key directly into the file; it replaces the environment reference if you sync that provider again.

Check the saved configuration

Confirm the provider, address and model in the file OpenCode actually reads. These checks catch a wrong host, an overwritten custom setting or a stale model before you start a coding session.

SettingExpected value or action
Providerprovider.antigravity-manager with npm set to @ai-sdk/anthropic.
Connectionoptions.baseURL reaches Manager and ends in /v1; options.apiKey supplies your gateway key.
Other providersCompare google, anthropic and any custom providers with your saved copy.
Existing Manager modelsSync merges models. Previously added entries can remain after you deselect them. Remove an unwanted entry explicitly from provider.antigravity-manager.models.
Custom model fieldsFor selected catalog models, sync refreshes fields such as limits and variants. Recheck your overrides after syncing.
Automatic backupThe first saved backup stays in place across later syncs. Keep a new dated copy before each change you may want to undo.
Where are the automatic backups?

Look beside the original file in the OpenCode config directory. Depending on which files existed before the change, you may see:

opencode.json.antigravity-manager.bak
opencode.jsonc.antigravity-manager.bak
antigravity-accounts.json.antigravity-manager.bak

Older installations can use the suffix .antigravity.bak. If sync created a brand-new file, there was no original file to back up. Check a backup’s date and contents before using Restore.

3. Select your model and reasoning variant

Run opencode models antigravity-manager to list the configured models, then select one with its full provider/model name. In interactive OpenCode, use /models to switch models.

Choose an ID your Manager account can use. If the gateway rejects it, check model availability and routing. Start with a plain request, then try a reasoning variant listed under that model’s variants field.

Synced model familyVariants generated by Manager 5.0.0
Claude thinkinglow: 8,192 tokens; medium: 16,384; high: 24,576; max: 32,768.
Gemini 3 Prolow and high, using the effort field. Medium and max are disabled.
Gemini 3 Flashlow, medium and high, using effort. Max is disabled.
Gemini 2.5 Flash ThinkingToken-budget variants. Use the values stored for that specific model.

These defaults come from Manager’s model configuration. The upstream model can impose additional limits. If a variant causes a budget error, retry the plain request and follow the thinking-budget checks below.

Terminal · replace MODEL_ID; requires a high variant
opencode run "Reply with a short hello. Do not use tools." --model antigravity-manager/MODEL_ID --variant high

4. Test a reply and two file reads

Send a short request first, then check that OpenCode can read a local file and handle a follow-up in the same conversation. Use an empty test folder so the first tool test stays easy to inspect.

Terminal · replace MODEL_ID with your working model
opencode run "Reply with a short hello. Do not use tools." --model antigravity-manager/MODEL_ID

Wait for a complete greeting and for the command to finish. Find the matching request in Manager’s API Monitor Dashboard to check which model handled it. If the command fails, resolve that error before adding tools or reasoning variants.

  1. Create an empty folder and add connection-check.txt with a short marker of your own, such as orchid-472.
  2. Open a terminal in that folder and run opencode --model antigravity-manager/MODEL_ID, replacing the model ID. For manual key setup, use the same terminal where you set the key.
  3. Send the first prompt below and allow the file read if OpenCode asks. Check that the tool reads the intended file and that the reply matches its marker.
  4. Change the marker yourself in your editor, save the file, and send the follow-up in the same conversation. The reply should contain the new marker after another file read.
First prompt · paste into OpenCode
Use the file-reading tool to read connection-check.txt in this folder. Reply with the marker exactly as written. Leave the file unchanged.
Follow-up · after you change the marker
Read connection-check.txt again using the file-reading tool. What is the marker now? Leave the file unchanged.

Each reply should finish and return control to you. If the first read works but the follow-up stalls or fails, save the smallest example and use the streaming and tool troubleshooting guide. Include the Manager and OpenCode versions and the failed step when reporting the problem.

Remove Manager or restore earlier settings

To disconnect only Manager, close OpenCode, save the current config, and remove the antigravity-manager entry from provider manually. Update any default model or small_model that points to it, then restart and select your previous provider.

Which legacy settings does Clear remove?

It removes a predefined set of older Antigravity model IDs from the Google and Anthropic providers, even when their base URLs differ from Manager’s. If a provider’s base URL matches the current Manager proxy, it also removes that provider’s baseURL and apiKey. The card enables this cleanup automatically.

Restore an automatic backup

Use Restore on the OpenCode card when you want to return to the saved files. Save another copy of your current settings and backups before confirming.

  • Manager prefers .antigravity-manager.bak over the older .antigravity.bak for the file it is checking. Restore moves the backup into place, so that backup is removed afterward.
  • Restore can also replace antigravity-accounts.json when an account backup exists, regardless of the current Sync accounts checkbox.
  • If only an account backup exists, Restore can succeed while leaving the provider config unchanged. Inspect both files after it finishes.
  • If no eligible backup exists, Manager reports No backup files found. Use your dated copy or remove the provider manually.

When both JSON and JSONC files are present, restore your intended copy to its original filename and check which file OpenCode loads. If you deleted opencode.jsonc but still have its backup, recover that copy manually. Keep later edits from your current file if the automatic backup predates them.

Fix common OpenCode connection errors

Start with the failing step: config loading, connecting to the proxy, selecting a model, or completing a tool request. Change one setting at a time and repeat the short text request.

Manager says OpenCode is missing, but it runs in my terminal
Check the executable path visible to Manager. A desktop app launched before a PATH change may need restarting. With WSL, containers or different user accounts, use the manual configuration in the environment where OpenCode runs.
The Manager provider or selected model is missing
Check the active JSON/JSONC file, custom paths and project overrides. Review enabled_providers and disabled_providers, then restart OpenCode and run opencode models antigravity-manager. Use the complete provider/model name.
Connection refused, 401, 403 or 404
Check that Manager is running and that the host and port are reachable from OpenCode. For 401, check the gateway key or missing environment variable; for 403, review the proxy’s access policy. For 404, check the /v1 base URL and the model named in the error. Follow the proxy connection checks.
thinking_budget is out of range, or a variant fails
Retry the same model without --variant. If that works, check the enabled variants and reduce the budget within the limit stated by the error. Keep Gemini effort settings and Claude token budgets in their respective model entries. Record the exact rejected field and version pair; avoid copying a budget limit from a different model.
Sync reports invalid JSON/JSONC
Save a copy and repair the syntax in the existing file. It must contain a JSON object; check braces, quoted property names and values. Manager leaves an invalid config unchanged. Keep your original backup while fixing it.
A plain reply works, but a file read or follow-up fails
Check the file path, permissions and tool approval in OpenCode. Repeat in a new test folder and conversation. If it still fails, record which tool or follow-up broke and consult tool and streaming diagnostics.
I need to report a problem
Include versions, the selected provider/model, the failed command and a small reproduction in the Manager issue tracker. Remove API keys, tokens and private file contents from logs and configuration. The diagnostics guide explains what to collect.

Related guides and documentation

Use the AI client connection guide for another application, or return to the setup guide for accounts, quotas and server deployment.

WINDOWS DOWNLOAD

Archive password

Keep this password to open your Windows download if prompted.