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

Verify it’s running:
3

Add at least one Google account

See the Account Management guide for details:

Configuration Methods

You can configure Claude Code in two ways:

Settings.json Configuration

Using Claude Models

Add this configuration to settings.json:
  • 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:
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:
Reload your shell:

Proxy Mode vs Paid Mode

The web console allows you to toggle between two modes:
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

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

Run Claude Code

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

Test a request

Send a simple prompt to Claude:
Check proxy logs:
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:
Usage:

Custom Proxy Port

If you’re running the proxy on a different port:
Update settings.json:

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:
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:
  2. If set, unset them:
  3. Restart your terminal
Ensure the proxy server is running:
Check the port matches your configuration:
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:
Check file permissions:
If running as a systemd service, set CLAUDE_CONFIG_PATH:
Bypass onboarding by adding to ~/.claude.json:
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