Skip to content

dvcrn/copilot-oauth-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Copilot OAuth Proxy

A FAST reverse proxy server written in Go that forwards /v1/chat/completions requests to the GitHub Copilot API, to expose the Copilot API to other tools

Warning

This is a reverse-engineered proxy of GitHub Copilot API. It is not supported by GitHub, and may break unexpectedly. Use at your own risk.

Warning

GitHub Security Notice: Excessive automated or scripted use of Copilot (including rapid or bulk requests, such as via automated tools) may trigger GitHub's abuse-detection systems. You may receive a warning from GitHub Security, and further anomalous activity could result in temporary suspension of your Copilot access.

GitHub prohibits use of their servers for excessive automated bulk activity or any activity that places undue burden on their infrastructure.

Please review:

Use this proxy responsibly to avoid account restrictions.

Setup

With mise:

mise use -g go:github.com/dvcrn/copilot-oauth-proxy/cmd/copilot-oauth-proxy@latest

With Go:

go install github.com/dvcrn/copilot-oauth-proxy/cmd/copilot-oauth-proxy@latest

With npm:

npm install -g copilot-oauth-proxy

(this is not written in js, just distributed through npm)

Authenticate

Run

copilot-oauth-proxy auth

which will start the Copilot auth flow

Then run

copilot-oauth-proxy server

to run the server

Optional Config

  • Set the COPILOT_TOKEN environment variable with your GitHub Copilot authentication token.
  • Optionally set PORT (defaults to 9871).

Auto-start on Boot (macOS)

To automatically start the proxy when your system boots:

# Install the launch agent
./install-launchagent.sh

# Check status
launchctl list | grep copilot-oauth-proxy

# View logs
tail -f ~/Library/Logs/copilot-oauth-proxy.log

# Stop the service
launchctl unload ~/Library/LaunchAgents/sh.d.copilot-oauth-proxy.plist

# Uninstall
./uninstall-launchagent.sh

About

Proxy server to translate /v1/chat/completions request to Copilot API

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors