github-router

Use your GitHub Copilot subscription to power Claude Code, Codex CLI, or any OpenAI/Anthropic-compatible tool.
github-router is a local reverse proxy that translates standard API formats to GitHub Copilot's backend. One command to start, copy-paste configs for your tools.
[!WARNING]
Unofficial. Not supported by GitHub. May break. Use responsibly.
Review the GitHub Copilot Terms and Acceptable Use Policies.
Quick Start
npx github-router@latest auth
npx github-router@latest start
The server runs at http://localhost:8787. Now pick your tool below.
Use with Claude Code
Option A: Interactive (recommended)
npx github-router@latest start --claude-code
Select your models, a launch command gets copied to your clipboard. Paste it in a new terminal.
Option B: Copy-paste config
Create .claude/settings.json in your project:
{
"env": {
"ANTHROPIC_BASE_URL": "http://localhost:8787",
"ANTHROPIC_API_KEY": "dummy",
"ANTHROPIC_AUTH_TOKEN": "dummy",
"ANTHROPIC_MODEL": "gpt-4.1",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "gpt-4.1",
"ANTHROPIC_SMALL_FAST_MODEL": "gpt-4.1-mini",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "gpt-4.1-mini",
"DISABLE_NON_ESSENTIAL_MODEL_CALLS": "1",
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
},
"permissions": {
"deny": ["WebSearch"]
}
}
Then run claude as normal.
Use with Codex CLI
npx github-router@latest start --codex
Or set the env vars yourself:
export OPENAI_BASE_URL="http://localhost:8787/v1"
export OPENAI_API_KEY="dummy"
codex --full-auto -m gpt-5.3-codex
Use with any OpenAI-compatible tool
Point any tool at http://localhost:8787/v1:
curl http://localhost:8787/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"model": "gpt-4.1", "messages": [{"role": "user", "content": "Hello"}]}'
API Endpoints
/v1/chat/completions | POST | OpenAI Chat Completions |
/v1/responses | POST | OpenAI Responses (Codex models) |
/v1/messages | POST | Anthropic Messages |
/v1/messages/count_tokens | POST | Anthropic token counting |
/v1/models | GET | OpenAI model list |
/v1/embeddings | POST | OpenAI embeddings |
/v1/search | POST | Web search |
/usage | GET | Copilot usage & quotas |
OpenAI-compatible endpoints are also available without the /v1 prefix (for example, /chat/completions).
Anthropic endpoints are only available under /v1/messages.
Model / endpoint compatibility
| gpt-4.1, gpt-4o | Yes | Yes | No |
| gpt-5.3-codex, gpt-5.2-codex | No | Yes | No |
| claude-opus-4.6, claude-sonnet-4.6 | Yes | No | Yes |
| o3, o4-mini | Yes | Yes | No |
Docker
Pre-built images on GitHub Container Registry:
docker pull ghcr.io/animeshkundu/github-router:latest
docker run -p 8787:8787 -e GH_TOKEN=your_token ghcr.io/animeshkundu/github-router
Or build locally:
docker build -t github-router .
docker run -p 8787:8787 -e GH_TOKEN=your_token github-router
Docker Compose
services:
github-router:
build: .
ports:
- "8787:8787"
environment:
- GH_TOKEN=your_github_token_here
restart: unless-stopped
Persistent token storage
mkdir -p ./github-router-data
docker run -p 8787:8787 -v $(pwd)/github-router-data:/root/.local/share/github-router github-router
CLI Reference
github-router start [options] Start the proxy server
github-router auth Authenticate with GitHub
github-router check-usage Show Copilot usage/quotas
github-router debug Print diagnostic info
--port, -p | Port | 8787 |
--verbose, -v | Debug logging | false |
--account-type, -a | individual / business / enterprise | individual |
--rate-limit, -r | Min seconds between requests | - |
--wait, -w | Queue requests instead of rejecting on rate limit | false |
--manual | Approve each request manually | false |
--github-token, -g | Pass token directly (skip auth flow) | - |
--claude-code, -c | Generate Claude Code launch command | false |
--codex | Generate Codex CLI launch command | false |
--show-token | Print tokens to console | false |
--proxy-env | Use HTTP_PROXY/HTTPS_PROXY env vars | false |
Development
bun install
bun run dev
bun test
bun run lint:all
bun run typecheck
bun run build
License
MIT