Common errors
401 Unauthorized from Copilot
401 Unauthorized from Copilot
EADDRINUSE: address already in use
EADDRINUSE: address already in use
This error occurs when another process is already using port 18080 (the default proxy port).Error message:Solutions:Option 1: Kill the existing processFind and terminate the process using port 18080:Then restart the proxy.Option 2: Use a different portSet the If you change the port, make sure to update the
COPILOT_PROXY_PORT environment variable to use an alternative port:ANTHROPIC_BASE_URL when launching Claude Code:Proxy running but Claude Code shows errors
Proxy running but Claude Code shows errors
If the proxy appears to be running but Claude Code cannot connect or shows authentication errors, the issue is usually with environment variables.Symptoms:Both variables are required:
- Claude Code shows connection errors
- Messages about missing API key
- Requests not reaching the proxy
ANTHROPIC_BASE_URL- Points Claude Code to your local proxy instead of Anthropic’s serversANTHROPIC_API_KEY- Can be any non-empty value (the proxy doesn’t validate it)
Auth file not found
Auth file not found
This error occurs when you try to start the proxy without authenticating first.Error message:Solution:Run the authentication script before starting the proxy:This will:
- Open GitHub’s device code flow in your browser
- Prompt you to authorize the application
- Save your access token to
~/.claude-copilot-auth.json
Web search not working
Web search not working
If web search functionality is not working or returning no results, check your search provider configuration.Symptoms:Solutions:Option 1: Use Brave Search API (recommended)For better and more reliable search results, configure Brave Search:The proxy will automatically use Brave Search when the API key is configured.Option 2: DuckDuckGo fallbackIf you’re not using Brave Search, the proxy falls back to DuckDuckGo Lite. If DuckDuckGo is showing CAPTCHAs or rate limiting:
- Web searches return no results
- Error messages about search providers failing
- CAPTCHA warnings from DuckDuckGo
- Get a free API key from api.search.brave.com (2000 queries/month free)
- Set the environment variable:
- Wait a few minutes before trying again
- Consider using Brave Search API instead
- The proxy automatically tries multiple search providers in sequence (scripts/proxy.mjs:32-49)
The proxy tries search providers in this order: Brave Search → DuckDuckGo Lite → DuckDuckGo Instant Answer API
Docker container fails to start
Docker container fails to start
If the Docker container won’t start or keeps restarting, check the logs and configuration.Check container logs:Common causes:Check if port is available:Rebuild the container:
- Auth file not mounted: Ensure
~/.claude-copilot-auth.jsonexists before starting Docker - Port conflict: Another service is using port 18080
- Permission issues: The auth file volume mount may have incorrect permissions
Health check
You can verify the proxy is running correctly by checking the health endpoint:Debug mode
For troubleshooting streaming issues, enable debug logging:Logs and diagnostics
Proxy logs
The proxy logs all requests and responses to the console:- Timestamp and request method/path
- Model mapping (Anthropic → Copilot)
- Stream mode and message count
- Status and completion
Docker logs
For Docker deployments, view container logs:Getting help
If you encounter an issue not covered here:- Check the GitHub issues
- Review the console logs for error messages
- Verify your GitHub Copilot subscription is active
- Ensure you’re using Node.js 18 or later