@galin.iliev/codex-proxy
v0.5.0
Published
Minimal proxy that lets OpenAI Codex CLI and Claude Code use GitHub Copilot
Downloads
175
Readme
@galin.iliev/codex-proxy
A local proxy that lets OpenAI Codex CLI and Claude Code use GitHub Copilot as their model backend.
How it works
Codex CLI ── OpenAI Responses API ─┐
├─> localhost:8080 ─> GitHub Copilot
Claude Code ── Anthropic Messages API ┘The proxy:
- Forwards OpenAI Responses and Chat Completions requests with Copilot authentication headers.
- Translates Claude Code's
POST /v1/messagesrequests into Copilot Chat Completions requests. - Translates normal and streaming Copilot responses back into Anthropic Messages API JSON and SSE events, including text, images, and tool use.
- Binds to
127.0.0.1and accepts browser CORS requests only from localhost.
Prerequisites
- Node.js >= 18
- GitHub Copilot subscription (individual, business, or enterprise)
Quick start
npm install
npm startOn first run, the proxy prompts for GitHub device-code authentication if no usable saved, CLI, or explicit token is available.
Codex CLI
OPENAI_BASE_URL=http://localhost:8080/v1 OPENAI_API_KEY=dummy codexClaude Code
ANTHROPIC_BASE_URL=http://localhost:8080 \
ANTHROPIC_AUTH_TOKEN=dummy \
ANTHROPIC_MODEL=claude-sonnet-4 \
claudePowerShell:
$env:ANTHROPIC_BASE_URL = "http://localhost:8080"
$env:ANTHROPIC_AUTH_TOKEN = "dummy"
$env:ANTHROPIC_MODEL = "claude-sonnet-4"
claudeScripts/startClaude.ps1 applies the Claude Code environment variables after
you start the proxy in another terminal.
Install from npm
npm install -g @galin.iliev/codex-proxy
codex-copilot-proxyOptions
-p, --port <port> Port to listen on (default: 8080)
-a, --account-type <type> individual | business | enterprise (default: individual)
-g, --github-token <token> GitHub token (or set GH_TOKEN)
--skip-token-exchange Use only behind a trusted egress proxy that rewrites Authorization
-h, --help Show helpUsing with gh CLI token
If you're already authenticated with the GitHub CLI:
node src/index.js --github-token "$(gh auth token)"Supported endpoints
| Local endpoint | Behavior |
|---|---|
| POST /v1/responses | Passes through to Copilot /v1/responses |
| POST /v1/chat/completions | Passes through to Copilot /chat/completions |
| POST /v1/messages | Translates Anthropic Messages to/from Copilot Chat Completions |
| GET /v1/models | Passes through to Copilot /models |
| GET / | Health check |
The Claude interface follows the behavior of
[email protected], with translation
kept inside this proxy so Codex and Claude Code share one authentication and
server process.
