LOCAL API · GETTING STARTED

Antigravity Manager API Proxy: Setup & First Request

Use Antigravity Manager’s API Proxy to connect an AI client to your accounts. Start the service, copy its API key, then send a short request to confirm that a model answers.

For desktop Antigravity Tools 5.0.0 · Updated

  1. Your AI clientSends a request and proxy key
  2. Manager API Proxy127.0.0.1:8045 by default
  3. Model providerUses an available account

Before you start

You need Antigravity Tools running, an account with access to a text model, and a terminal on the same computer.

This setup sends requests through your saved accounts. If you have already configured custom model mappings or another provider, check where the chosen model routes before testing. The model guide explains those routing settings.

1. Start the local API proxy

Open API Proxy → Service Configuration, keep access local, and enable request authentication before starting the service.

  1. Check Listen Port. The default is 8045. If the service is already running, click Stop Service before changing the port.
  2. Leave Allow LAN Access off. For this setup, the proxy listens on 127.0.0.1, which your computer uses to reach itself.
  3. Set Authorization → Mode to All except Health. Model requests will require a key, while the connection check below can run without one.
  4. Copy the API Key. Use the value shown in API Proxy. Paste it into the requesting client or the hidden prompt in the Python example. Keep it private.
  5. Click Start Service. Look for Service Running and the loaded-account count. If it stays stopped with zero accounts, add or re-enable an account for proxy use. For a startup error, read the message before changing another setting.

The proxy key gives clients access to Manager. Manager uses the saved account credentials when contacting the model provider. Enter the proxy’s API Key in client settings; keep Google sign-in tokens and any separate Web UI password in their own settings.

Settings save as you change them. Port or LAN-binding changes require a restart. If the old listener remains after Stop Service, fully quit and reopen Manager to apply the new address.

What do the four authentication modes mean?
All except Health
AI requests require a valid key. /healthz remains available without a key while the proxy is running. Use this mode for the steps below.
All (Strict)
AI requests and /healthz require a valid key.
Off (Open)
The AI endpoints accept requests without checking a key.
Auto (Recommended)
Manager uses Off for local-only access and All except Health when Allow LAN Access is enabled. Select an explicit mode when checking key enforcement.

These options control the AI proxy. Management routes under /api use separate authentication rules; see access controls and key types.

2. Check the connection

Request /healthz from the same computer to check that Manager responds at the chosen address and port.

Terminal · macOS / Linux
curl --include --max-time 10 http://127.0.0.1:8045/healthz

In Windows PowerShell, run curl.exe --include --max-time 10 http://127.0.0.1:8045/healthz. Change 8045 in either command if you configured another port.

A running proxy in All except Health mode returns HTTP 200 with JSON containing "status": "ok" and a version field. Continue to the model request to check the account and model.

If you selected All (Strict), a request without a key returns 401. Either send the API key in your HTTP tool’s Bearer authorization field or select All except Health to follow this walkthrough.

Check that a key is required

With the service running in All except Health mode, run curl --include --max-time 10 http://127.0.0.1:8045/v1/models, using curl.exe on Windows. This request sends no key and should return 401. A 200 response means you should recheck the mode and the server address before continuing.

3. Send your first model request

Send a short text prompt with the proxy key and a model ID available to your account.

  1. Open Model Catalog & Protocols in API Proxy and copy the exact ID of a text model. Check the account’s model access and quota; use model selection and mapping if you are unsure which ID to use.
  2. Copy the example below into a file named first_request.py.
  3. Run python3 first_request.py on macOS/Linux or py first_request.py on Windows.
  4. At the first prompt, press Enter for http://127.0.0.1:8045, or enter your configured root address. Then enter the API key and model ID. The key stays hidden as you type.
Python 3 · no SDK required
import getpass
import json
import urllib.error
import urllib.parse
import urllib.request

root = input("Proxy root [http://127.0.0.1:8045]: ").strip()
root = (root or "http://127.0.0.1:8045").rstrip("/")
try:
    url = urllib.parse.urlsplit(root)
    valid = (url.scheme in ("http", "https") and url.hostname
             and not (url.path or url.query or url.fragment)
             and url.username is None and url.password is None)
    port = url.port
except ValueError:
    valid = False
if not valid:
    raise SystemExit("Enter the proxy root, with no /v1 or endpoint path.")

key = getpass.getpass("API Key from API Proxy (hidden): ").strip()
model = input("Model ID: ").strip()
if not key or not model:
    raise SystemExit("Enter both the API key and a model ID.")

payload = {
    "model": model,
    "messages": [{"role": "user", "content": "Reply with a short hello."}],
    "stream": False,
}
req = urllib.request.Request(
    root + "/v1/chat/completions",
    data=json.dumps(payload).encode("utf-8"),
    headers={"Authorization": "Bearer " + key,
             "Content-Type": "application/json"},
)
# Connect directly to Manager, without a system HTTP proxy.
client = urllib.request.build_opener(urllib.request.ProxyHandler({}))
try:
    with client.open(req, timeout=120) as response:
        result = json.load(response)
    print(json.dumps(result, indent=2, ensure_ascii=False))
except urllib.error.HTTPError as error:
    print("HTTP", error.code)
    print(error.read().decode("utf-8", errors="replace"))
    raise SystemExit(1)
except (urllib.error.URLError, TimeoutError) as error:
    raise SystemExit("Connection failed: " + str(error))
except (ValueError, UnicodeError):
    raise SystemExit("The server returned an unreadable JSON response.")

Enter only the root address at the prompt. The script adds /v1/chat/completions and sends one non-streaming request. The model’s reply uses account quota.

Read the response

Find choices[0].message.content in the printed JSON and read the reply. A successful first request contains a meaningful answer to the greeting. If the body contains an error, an unsupported-version message or empty content, follow the matching troubleshooting step.

Manager’s request monitor can help you match the request to its model and serving account. If you share an error report, remove API keys, account emails and personal content. The logs and diagnostics guide explains what to collect.

Once the reply works, enter the same key and the appropriate base URL in your AI client. Use the client guides to check streaming, tool calls and follow-up messages in that application.

Which base URL should your client use?

Use a base URL that combines with the path your client adds to form one complete endpoint.

Scroll the table sideways to see the full addresses.

Local addresses for port 8045. Replace the port if yours differs.
What the client addsBase URL to enterFinal request path
OpenAI Chat Completions: /chat/completionshttp://127.0.0.1:8045/v1/v1/chat/completions
OpenAI Responses: /responseshttp://127.0.0.1:8045/v1/v1/responses
Full Chat Completions path: /v1/chat/completionshttp://127.0.0.1:8045/v1/chat/completions
Anthropic Messages: /v1/messageshttp://127.0.0.1:8045/v1/messages
Gemini native: version, model and methodhttp://127.0.0.1:8045/v1beta/models/MODEL:generateContent

If your HTTP tool asks for a complete endpoint, enter http://127.0.0.1:8045/v1/chat/completions directly. If the final request contains /v1/v1, remove the duplicated version prefix from the base URL.

For AI requests, send the proxy key as Authorization: Bearer …, x-api-key or x-goog-api-key, according to your client’s protocol. Configure one credential source consistently: an old Authorization header takes precedence over the other key headers.

The API reference covers request formats. For app-specific setup, continue to Claude Code, OpenCode or the client connection overview.

Connect from another device

Enable Allow LAN Access, keep authentication enabled, then restart Manager to apply the binding change. Use the Manager computer’s reachable IP address in the remote client and allow the chosen port through its firewall. On another device, 127.0.0.1 refers to that device itself.

The wildcard addresses 0.0.0.0 and [::] describe where the server listens; use the computer’s actual address as the destination. For access over the internet, follow remote access and HTTPS setup before sending keys or prompts.

Fix a failed connection or request

Use the status code and response body to identify which part of the connection needs attention.

The service cannot bind its port
Check whether another process uses Listen Port. Stop only the process you recognize, or choose a free port in Manager and update the client URL. If the old Manager listener remains, quit and reopen the app.
Connection refused or timeout
Check Service Running, the port and the computer hosting Manager. Start with the local health check above. If local requests work but a remote device fails, check LAN binding, firewall and reachability. See connection troubleshooting.
401 Unauthorized
The request may be missing a key. Copy API Key again, check the client’s authentication field and remove stale credentials. In All (Strict) mode, include the key for /healthz too.
403 with token_rejected
Manager rejected the supplied credential. In 5.0.0, an unknown key can produce this response. Compare it with API Key; if you use a separate user token, inspect the rejection message for its expiry, IP or time restrictions. A provider-side 403 may instead require account verification.
404 Not Found
Check the final request path against the table. If the path is correct, inspect the response for an upstream model or client-version error. Then check the selected model and Manager version.
503 with “Proxy service is currently disabled”
Open API Proxy and click Start Service. This message means the local proxy is stopped.
Health works, but the model request returns 429 or another 503
Check the account’s proxy availability, model access, quota and protection state. Follow 429 and 503 troubleshooting for the reported cause and quota and account-rotation settings if the account is being skipped.
The script returns HTML or an unreadable response
Confirm that the URL points to Manager’s API port. A web login page or another service on that port can return a different response format.

For a reproducible failure, collect the time, Manager version, client, requested model, final URL, status and a redacted response. Use the diagnostic checklist before reporting it.

Control autostart and stop the proxy

Use Auto Start with App to choose whether the proxy starts when Manager opens.

In 5.0.0, Start Service also turns on Auto Start with App; Stop Service turns it off. After starting a temporary session, turn the checkbox off if you want the next app launch to leave the proxy stopped. Operating-system login startup is a separate app setting.

Click Stop Service when you finish using the proxy. Model endpoints stop forwarding requests. In this version, /healthz also returns 503 while stopped; /health and management endpoints can remain reachable.

To release the listener completely, quit Manager using its exit action. Closing the window can leave it running in the system tray. After changing a port or LAN setting, reopen Manager and check the new address before reconnecting clients.

If you regenerate the API key, update every client using the old value. Continue to key management and access controls when sharing access with other users.

Next steps and product documentation

Connect your preferred client once the first request returns a model reply.

Browse all Antigravity Manager guides →

Back to proxy setup ↑

WINDOWS DOWNLOAD

Archive password

Keep this password to open your Windows download if prompted.