Skip to main content
This guide shows you how to configure the Claude Code CLI to route requests through the Antigravity Claude Proxy instead of using official Anthropic credits.

Prerequisites

1

Install Claude Code CLI

Follow the official installation instructions at claude.ai/code
2

Start the proxy server

acc start
# or: antigravity-claude-proxy start
Verify it’s running:
curl http://localhost:8080/health
3

Add at least one Google account

See the Account Management guide for details:
antigravity-claude-proxy accounts add

Configuration Methods

You can configure Claude Code in two ways:

Settings.json Configuration

Using Claude Models

Add this configuration to settings.json:
{
  "env": {
    "ANTHROPIC_AUTH_TOKEN": "test",
    "ANTHROPIC_BASE_URL": "http://localhost:8080",
    "ANTHROPIC_MODEL": "claude-opus-4-6-thinking",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-4-6-thinking",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-4-5-thinking",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-sonnet-4-5",
    "CLAUDE_CODE_SUBAGENT_MODEL": "claude-sonnet-4-5-thinking",
    "ENABLE_EXPERIMENTAL_MCP_CLI": "true"
  }
}
  • ANTHROPIC_AUTH_TOKEN: Set to "test" (any value works, proxy doesn’t validate)
  • ANTHROPIC_BASE_URL: Proxy server address (default: http://localhost:8080)
  • ANTHROPIC_MODEL: Primary model for requests
  • ANTHROPIC_DEFAULT_OPUS_MODEL: Model used when you specify “opus”
  • ANTHROPIC_DEFAULT_SONNET_MODEL: Model used when you specify “sonnet”
  • ANTHROPIC_DEFAULT_HAIKU_MODEL: Model used when you specify “haiku”
  • CLAUDE_CODE_SUBAGENT_MODEL: Model for sub-agents (use faster model)
  • ENABLE_EXPERIMENTAL_MCP_CLI: Enable MCP (Model Context Protocol) support

Using Gemini Models

To use Google Gemini models instead of Claude:
{
  "env": {
    "ANTHROPIC_AUTH_TOKEN": "test",
    "ANTHROPIC_BASE_URL": "http://localhost:8080",
    "ANTHROPIC_MODEL": "gemini-3.1-pro-high[1m]",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "gemini-3.1-pro-high[1m]",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "gemini-3-flash[1m]",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "gemini-3-flash[1m]",
    "CLAUDE_CODE_SUBAGENT_MODEL": "gemini-3-flash[1m]",
    "ENABLE_EXPERIMENTAL_MCP_CLI": "true"
  }
}
See the Available Models documentation for a complete list of supported models and their capabilities.

Environment Variables

Alternatively, set environment variables in your shell profile:
Add to ~/.zshrc:
export ANTHROPIC_BASE_URL="http://localhost:8080"
export ANTHROPIC_AUTH_TOKEN="test"
export ANTHROPIC_MODEL="claude-opus-4-6-thinking"
Reload your shell:
source ~/.zshrc

Proxy Mode vs Paid Mode

The web console allows you to toggle between two modes:
FeatureProxy ModePaid Mode
BackendLocal proxy server (Antigravity)Official Anthropic API
CostFree (uses Google Cloud quotas)Paid (requires Anthropic credits)
ModelsClaude + GeminiClaude only
ConfigurationSets proxy URL in settings.jsonClears proxy settings
Paid Mode automatically removes proxy settings from settings.json so you can use your official Anthropic account without conflicts.

Verification Steps

Confirm Claude Code is using the proxy:
1

Check proxy is running

acc status
Should show: Proxy is running (PID: xxxx)
2

Run Claude Code

claude
If prompted to select a login method, add this to ~/.claude.json (macOS/Linux) or %USERPROFILE%\.claude.json (Windows):
{
  "hasCompletedOnboarding": true
}
Then restart your terminal.
3

Test a request

Send a simple prompt to Claude:
> What is 2+2?
Check proxy logs:
acc start --log
You should see request logs showing which account and model were used.

Advanced Configurations

Multiple Claude Code Instances

Run both official Claude Code and Antigravity version simultaneously:
Add alias to ~/.zshrc or ~/.bashrc:
alias claude-antigravity='CLAUDE_CONFIG_DIR=~/.claude-account-antigravity ANTHROPIC_BASE_URL="http://localhost:8080" ANTHROPIC_AUTH_TOKEN="test" command claude'
Usage:
claude           # Official API with your credits
claude-antigravity  # Proxy server with free quota

Custom Proxy Port

If you’re running the proxy on a different port:
# Start proxy on custom port
PORT=3001 acc start
Update settings.json:
{
  "env": {
    "ANTHROPIC_BASE_URL": "http://localhost:3001"
  }
}

Running as systemd Service

When running the proxy as a systemd service, set CLAUDE_CONFIG_PATH to point to the real user’s .claude directory:
# /etc/systemd/system/antigravity-proxy.service
[Service]
Environment=CLAUDE_CONFIG_PATH=/home/youruser/.claude
ExecStart=/usr/bin/node /path/to/antigravity-claude-proxy/src/index.js
Without this, the WebUI’s Claude CLI tab won’t be able to read or write your Claude Code configuration.

Troubleshooting

Check configuration precedence:
  1. Verify environment variables aren’t overriding settings.json:
    echo $ANTHROPIC_BASE_URL
    
  2. If set, unset them:
    unset ANTHROPIC_BASE_URL
    unset ANTHROPIC_AUTH_TOKEN
    
  3. Restart your terminal
Ensure the proxy server is running:
acc status
# If not running:
acc start
Check the port matches your configuration:
curl http://localhost:8080/health
The proxy doesn’t validate tokens. If you see this error, Claude Code may be trying to use the official API instead of the proxy.Verify ANTHROPIC_BASE_URL is set correctly:
{
  "env": {
    "ANTHROPIC_BASE_URL": "http://localhost:8080"
  }
}
Check file permissions:
ls -la ~/.claude/settings.json
If running as a systemd service, set CLAUDE_CONFIG_PATH:
export CLAUDE_CONFIG_PATH=/home/youruser/.claude
Bypass onboarding by adding to ~/.claude.json:
{
  "hasCompletedOnboarding": true
}
Restart your terminal after making this change.

Next Steps

Load Balancing

Configure multi-account strategies for optimal performance

Available Models

Explore supported Claude and Gemini models

Web Console

Monitor usage and manage accounts visually

Account Management

Add and configure Google accounts

Build docs developers (and LLMs) love