Skip to main content
The Claude Code Copilot proxy is configured through environment variables. These variables control the server port, authentication, web search providers, and other behavior.

Server configuration

COPILOT_PROXY_PORT
integer
default:"18080"
The port on which the proxy server listens for incoming requests.
# Server runs on http://localhost:18080
node scripts/proxy.mjs
Source: scripts/proxy.mjs:18
COPILOT_AUTH_FILE
string
default:"~/.claude-copilot-auth.json"
Path to the authentication file containing your GitHub Copilot access token.The auth file is created when you run node scripts/auth.mjs and contains:
  • access_token - Your GitHub OAuth token
  • provider - Always “github-copilot”
  • github_user - Your GitHub username
  • created_at - Timestamp of authentication
# Uses ~/.claude-copilot-auth.json
node scripts/proxy.mjs
Source: scripts/proxy.mjs:19-20, scripts/auth.mjs:18-19

Web search configuration

BRAVE_API_KEY
string
default:""
API key for Brave Search integration. When provided, the proxy uses Brave Search as the primary web search provider.Getting a Brave API key:
  1. Visit https://api.search.brave.com/
  2. Sign up for a free account
  3. Create an API key from your dashboard
  4. Add it to your environment
export BRAVE_API_KEY="your-api-key-here"
node scripts/proxy.mjs
When BRAVE_API_KEY is set:
  • Primary: Brave Search API
  • Fallback: DuckDuckGo Lite → DuckDuckGo Instant Answer API
Source: scripts/proxy.mjs:23
WEB_SEARCH_MAX_RESULTS
integer
default:"5"
Maximum number of search results to return per web search query.
node scripts/proxy.mjs
This limit applies to all search providers (Brave, DuckDuckGo Lite, DuckDuckGo Instant Answer).Source: scripts/proxy.mjs:24

Debugging

DEBUG_STREAM
string
default:""
Enable debug logging for streaming responses. Set to "1" to see detailed stream chunk information.
DEBUG_STREAM=1 node scripts/proxy.mjs
When enabled, the proxy logs each streaming chunk with delta information and finish reasons to help debug streaming issues.Source: scripts/proxy.mjs:689

Claude Code integration

ANTHROPIC_BASE_URL
string
required
Points Claude Code to use the proxy server instead of Anthropic’s API.
ANTHROPIC_BASE_URL=http://localhost:18080
If you changed COPILOT_PROXY_PORT, update this URL accordingly:
COPILOT_PROXY_PORT=3000 node scripts/proxy.mjs
# Then use:
ANTHROPIC_BASE_URL=http://localhost:3000
ANTHROPIC_API_KEY
string
required
When using the proxy, set this to any non-empty value. The actual authentication is handled by your GitHub Copilot token.
ANTHROPIC_API_KEY=copilot-proxy
The proxy ignores this value and uses COPILOT_AUTH_FILE for authentication.

Complete example

# Start the proxy
node scripts/proxy.mjs

# In another terminal, run Claude Code
export ANTHROPIC_BASE_URL=http://localhost:18080
export ANTHROPIC_API_KEY=copilot-proxy
claude

Docker environment

When running with Docker Compose, set these variables in a .env file:
.env
BRAVE_API_KEY=your-api-key-here
WEB_SEARCH_MAX_RESULTS=5
The Docker container automatically:
  • Exposes port 18080 (configurable in docker-compose.yml)
  • Mounts ~/.claude-copilot-auth.json as read-only
  • Sets COPILOT_PROXY_PORT=18080
Source: docker-compose.yml:10-13