coproxy
OpenAI-compatible API proxy backed by GitHub Copilot.
[!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.
Installation
From crates.io
From source
Prebuilt binaries
Download from GitHub Releases. Available for Linux (x86_64, aarch64) and macOS (x86_64, aarch64).
Docker
On first run, the container will print a GitHub device login URL and code to stdout. Complete the auth flow in your browser, and the server will start automatically.
To persist credentials across restarts, mount a volume:
Quick start
# First-time login (opens GitHub device flow)
# Start the proxy
# Verify it works
Usage with OpenAI Python client
=
# Chat completions
=
# Streaming
=
# Responses API (model-dependent, e.g. gpt-5.4)
=
# List models
API surface
| Endpoint | Status |
|---|---|
POST /v1/chat/completions |
Supported (sync + stream) |
GET /v1/models |
Supported |
GET /v1/models/{model} |
Supported |
POST /v1/responses |
Passthrough (model-dependent) |
GET /v1/responses/{response_id} |
Passthrough |
POST /v1/embeddings |
Not supported |
Configuration
CLI flags
| Flag | Default | Description |
|---|---|---|
--host |
127.0.0.1 |
Bind address |
--port |
8080 |
Bind port |
--api-surface |
chat |
API surface: chat, chat-responses, chat-embeddings, all |
--api-key |
none | Require Bearer token for /v1/* routes |
--default-model |
gpt-4o |
Default model when requests omit model |
--state-dir |
OS default | Override credential storage path |
--no-auto-login |
false | Skip automatic auth bootstrap at startup |
--log-level |
info |
Log level filter |
Environment variables
| Variable | Equivalent to |
|---|---|
GHCP_GITHUB_TOKEN |
--github-token (skip device flow, use this token directly) |
GHCP_PROXY_API_KEY |
--api-key |
Authentication
On first run, coproxy triggers GitHub device flow:
- Prints a verification URL and user code.
- Polls GitHub OAuth until you authorize.
- Exchanges GitHub token for a GHCP API token.
- Caches both tokens locally with restricted file permissions (
0600).
Or skip device flow entirely by providing a GitHub token:
Running as a service
systemd (Linux)
Copy contrib/coproxy.service to /etc/systemd/system/ and adjust as needed:
launchd (macOS)
Copy contrib/com.coproxy.plist to ~/Library/LaunchAgents/:
Development
# OpenAI compatibility tests (requires uv + GHCP auth)
License
MIT