Skip to main content

Overview

Antigravity Manager supports flexible authentication modes to balance security and convenience. You can configure authentication behavior based on whether you’re running locally or exposing the API to your network.

Authentication Modes

The API supports four authentication modes: Automatically selects the appropriate authentication strategy:
  • Local only (allow_lan_access: false): No authentication required
  • LAN access (allow_lan_access: true): Authentication required for all endpoints except health checks

Off Mode

Disables all authentication. Suitable for local development only.
Never use off mode when exposing the API to your network or the internet.

Strict Mode

Requires authentication for all endpoints, including health checks.

All Except Health Mode

Requires authentication for all endpoints except /health and /healthz.

API Key Authentication

Setting Your API Key

You can set the API key in three ways: 1. Configuration File (~/.antigravity_tools/gui_config.json):
2. Environment Variable:
3. Docker Container:

Using API Keys in Requests

Include your API key in one of these headers:

X-API-Key Header

X-Goog-API-Key Header (Gemini Protocol)

Admin Password

For enhanced security, you can set a separate password for the Web UI management interface:

Password Configuration

Configuration File:
Environment Variable (Docker):

Password Priority

  1. Environment Variable (WEB_PASSWORD or ABV_WEB_PASSWORD) - Highest priority
  2. Configuration File (admin_password in gui_config.json)
  3. Fallback - Uses api_key if no admin password is set

Authentication Logic

Setting a separate admin password allows you to share the API key with team members while keeping admin access restricted.

User Tokens

User tokens provide granular access control for multi-user environments. They allow you to:
  • Create separate access tokens for different users or applications
  • Track usage per token
  • Set expiration dates and rate limits
  • Revoke access without changing the main API key

Creating User Tokens

User tokens can be created via the Web UI or API:

Using User Tokens

Use user tokens the same way as API keys:

Token Validation

When auth_mode is enabled, user tokens are validated against:
  • Expiration date - Token must not be expired
  • IP restrictions - Optional IP whitelist/blacklist
  • Rate limits - Per-token request limits
  • Revocation status - Token must be active

IP Filtering

Enhance security with IP-based access control:

IP Whitelist

Allow only specific IP addresses:
Add IPs via API:

IP Blacklist

Block specific IP addresses:
Add IPs via API:

Security Best Practices

The auto authentication mode automatically enables security when you expose the API to your network while keeping local development convenient.
Use a separate, strong password for admin access. This allows you to share API keys with team members while protecting administrative functions.
Create individual user tokens for team members instead of sharing the main API key. This enables better access control and usage tracking.
If exposing the API to the internet, use IP whitelisting to restrict access to known addresses.
Periodically generate new API keys and user tokens, especially after team member changes.
Regularly review access logs and security events in the Web UI to detect unauthorized access attempts.

Examples

OpenAI SDK with Authentication

Claude Code CLI

cURL with All Headers

Troubleshooting

401 Unauthorized

Cause: Missing or invalid API key Solution:
  • Verify the API key is set correctly
  • Check that you’re using the correct header (Authorization, x-api-key, or x-goog-api-key)
  • Ensure the auth mode allows your request

403 Forbidden

Cause: IP blocked or user token rejected Solution:
  • Check IP whitelist/blacklist settings
  • Verify user token hasn’t expired
  • Ensure the user token hasn’t been revoked

Admin Interface Not Accessible

Cause: Wrong password when separate admin password is set Solution:
  • Use WEB_PASSWORD for admin login, not API_KEY
  • Check gui_config.json for the correct admin_password
  • Review environment variables (they take priority)

Next Steps

Model Routing

Configure model mappings and routing rules

User Management

Set up user tokens and access control