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.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/badrisnarayanan/antigravity-claude-proxy/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Install Claude Code CLI
Follow the official installation instructions at claude.ai/code
Add at least one Google account
See the Account Management guide for details:
Configuration Methods
You can configure Claude Code in two ways:- Web Console (Recommended)
- Manual Configuration
The easiest way to configure Claude Code:
Settings.json Configuration
Using Claude Models
Add this configuration tosettings.json:
Field Descriptions
Field Descriptions
- 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:- macOS (Zsh)
- macOS/Linux (Bash)
- Windows (PowerShell)
- Windows (CMD)
Add to Reload your shell:
~/.zshrc:Proxy Mode vs Paid Mode
The web console allows you to toggle between two modes:| Feature | Proxy Mode | Paid Mode |
|---|---|---|
| Backend | Local proxy server (Antigravity) | Official Anthropic API |
| Cost | Free (uses Google Cloud quotas) | Paid (requires Anthropic credits) |
| Models | Claude + Gemini | Claude only |
| Configuration | Sets proxy URL in settings.json | Clears proxy settings |
Verification Steps
Confirm Claude Code is using the proxy:Run Claude Code
~/.claude.json (macOS/Linux) or %USERPROFILE%\.claude.json (Windows):Advanced Configurations
Multiple Claude Code Instances
Run both official Claude Code and Antigravity version simultaneously:- macOS/Linux
- Windows (PowerShell)
Add alias to Usage:
~/.zshrc or ~/.bashrc:Custom Proxy Port
If you’re running the proxy on a different port:settings.json:
Running as systemd Service
When running the proxy as a systemd service, setCLAUDE_CONFIG_PATH to point to the real user’s .claude directory:
Troubleshooting
Claude Code still using official API
Claude Code still using official API
Check configuration precedence:
- Verify environment variables aren’t overriding
settings.json: - If set, unset them:
- Restart your terminal
Connection refused error
Connection refused error
Ensure the proxy server is running:Check the port matches your configuration:
Invalid authentication token
Invalid authentication token
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:Web Console can't modify settings.json
Web Console can't modify settings.json
Check file permissions:If running as a systemd service, set
CLAUDE_CONFIG_PATH:Claude Code asks to select login method
Claude Code asks to select login method
Bypass onboarding by adding to Restart your terminal after making this change.
~/.claude.json: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