copilot-proxy is a local GitHub Copilot API proxy. It accepts OpenAI-style and Anthropic-style client requests on local endpoints, then forwards them to https://api.githubcopilot.com with authentication and header adaptation.
- OpenAI-compatible endpoints:
POST /v1/chat/completionsPOST /v1/responses
- Anthropic-compatible endpoint:
POST /v1/messages
- Models endpoint:
GET /copilot/models
- Endpoint mapping:
/v1/chat/completions->/chat/completions/v1/responses->/responses/copilot/models->/models/v1/messagescan route to/v1/messages,/chat/completions, or/responsesdepending on selected model endpoint support
Default listen address: 127.0.0.1:4000.
curl -fsSL https://rexxiang.github.io/copilot-proxy/install.sh | shDefault install path is ~/.local/bin/copilot-proxy.
Use a custom install directory:
curl -fsSL https://rexxiang.github.io/copilot-proxy/install.sh | INSTALL_DIR="$HOME/.local/bin" shIf needed, add it to PATH:
export PATH="$HOME/.local/bin:$PATH"mise x -- go build -o ./bin/copilot-proxy ./cmd/copilot-proxycopilot-proxy auth loginThis uses GitHub device flow and stores credentials in ~/.config/copilot-proxy/auth.json.
Run with the TUI monitor (default when TTY is available):
copilot-proxyOr run without TUI:
copilot-proxy --no-tuiexport ANTHROPIC_BASE_URL='http://127.0.0.1:4000'copilot-proxy auth ls
copilot-proxy auth rm <user>- C API integration guide: docs/c-api-integration.md