ghc-proxy
A GitHub Copilot API proxy written in Rust. It exposes standard OpenAI and Anthropic compatible HTTP endpoints so any tool — Claude Code, the Codex CLI, the OpenAI/Anthropic SDKs, and more — can talk to GitHub Copilot models.
Documentation: Getting Started · Configuration · API Reference · Claude Code & Codex
What it does
Your tool ghc-proxy GitHub Copilot
┌──────────────┐ OpenAI/ ┌──────────────┐ disguised ┌──────────────┐
│ Claude Code │ Anthropic │ translate │ as the │ api.github │
│ Codex CLI ├──────────►│ + filter ├───────────►│ copilot.com │
│ OpenAI SDK │ HTTP │ + retry │ VS Code │ │
└──────────────┘ └──────────────┘ client └──────────────┘
The proxy authenticates to GitHub Copilot by faithfully impersonating the official VS Code Copilot Chat client, then re-shapes requests and responses so OpenAI- and Anthropic-native clients work unmodified.
Highlights
- OpenAI-compatible
/v1/chat/completionsand/v1/responses(Codex) endpoints. - Anthropic-compatible
/v1/messagesendpoint with native passthrough or translation. - Embeddings, model listing, token counting, and a usage endpoint.
- Model-name translation via configurable exact and longest-prefix mappings.
- Streaming (SSE), retry with backoff, and content filtering.
- 1M-context support via the
anthropic-betaheader for capable models. - Interactive setup wizard — GitHub sign-in, live model catalog, model mapping.
- Claude Code integration — one flag wires
~/.claude/settings.jsonto the proxy. - Analytics dashboard at
/and a request browser at/requests.
Quick start
# Build
cargo build --release
# Run — first launch in a terminal opens the interactive setup wizard
./target/release/ghc-proxy
Point any OpenAI client at http://127.0.0.1:8314/v1:
curl http://127.0.0.1:8314/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"model": "gpt-4o", "messages": [{"role": "user", "content": "Hello!"}]}'
Continue with the Getting Started guide.
ghc-proxy is a community project and is not affiliated with or endorsed by GitHub or Microsoft. Use it in accordance with the GitHub Copilot terms of service.