0
0
via GitHub · Posted Jul 13, 2026 · 1 min read

Copilot API Proxy

Jer-y/copilot-proxy
Tool

Turn GitHub Copilot into an OpenAI/Anthropic-compatible server with Claude Code and Codex support.

30Stars
16Forks
6Open issues
TypeScript MIT v0.7.16 Updated 1 week ago

A reverse-engineered proxy that exposes GitHub Copilot as OpenAI and Anthropic-compatible HTTP endpoints. It enables using Copilot with external tools like Claude Code, Codex, and custom applications that expect standard API formats.

0 comments

README

English | 简体中文

Copilot API Proxy

A local, single-user adapter that exposes one GitHub Copilot identity through OpenAI- and Anthropic-compatible APIs for Claude Code, Codex, SDKs, and custom tools.

[!IMPORTANT] copilot-proxy is designed for one trusted user on loopback. Business and enterprise account modes select a Copilot upstream route; they do not add downstream authentication, tenant isolation, audit, billing, or enterprise governance. See product support before using a gateway or non-loopback listener.

[!WARNING] This is a reverse-engineered proxy. It is not supported by GitHub and may break when Copilot changes. Excessive automated or bulk use may trigger GitHub abuse controls. Review the GitHub Acceptable Use Policies and GitHub Copilot Terms, and use it responsibly.

Quick start

Requirements: a GitHub account with an individual, business, or enterprise Copilot subscription; Node.js >= 22.19.0 for a registry release, or Git and Bun >= 1.3.6 for the current source checkout. Running setup codex also requires Codex >= 0.134.0 on PATH.

From an empty directory, choose either the published package or the current source checkout. To install the registry release globally or run it once without installing:

npm install --global @jer-y/copilot-proxy@latest
copilot-proxy --help
copilot-proxy start

# One-shot alternative
npx --yes @jer-y/copilot-proxy@latest --help
npx --yes @jer-y/copilot-proxy@latest start

The registry's latest release can lag this checkout and may not yet expose setup, models, or doctor. Check the selected release's --help instead of assuming those commands exist. To use the guided workflow documented below, start from an empty directory and run:

git clone https://github.com/Jer-y/copilot-proxy.git
cd copilot-proxy
bun install --frozen-lockfile
  1. Run setup for the client you use. Choose one:

    bun run ./src/main.ts setup claude
    bun run ./src/main.ts setup codex
    bun run ./src/main.ts setup openai-sdk
    

    Setup authenticates, selects and probes a direct route, then prints configuration without writing client configuration files. It may update copilot-proxy's own authentication data, but it does not save or launch the generated client profile. HTTP eligibility treats a non-empty live supported_endpoints list as authoritative and otherwise may use bundled proxy policy; WebSocket always requires explicit live ws:/responses. Those eligibility inputs are not live route or semantic proof—the probe is. Codex has additional installed-version and model-metadata checks; see Getting started.

  2. Start the proxy in another terminal with the exact command printed by setup. For the default source setup, the equivalent short form is:

    bun run ./src/main.ts start --preset personal
    
  3. Apply the generated configuration. You can inspect the current catalog or diagnose the running service with:

    bun run ./src/main.ts models --client codex
    bun run ./src/main.ts doctor --client codex
    

Replace codex with claude or openai-sdk where appropriate. Configuration safety, non-interactive use, and troubleshooting are covered in Getting started.

When the proxy starts, it prints a link to the hosted diagnostics dashboard for the active listener. This is a remote GitHub Pages site: opening it sends the encoded local endpoint in the URL query to that site before your browser reads /diagnostics. Use doctor or curl instead when that endpoint must remain local. See Operations for the trust boundary.

Capabilities

Area Summary
OpenAI-compatible APIs Chat Completions, Responses over HTTP/SSE, Models, and Embeddings
Anthropic-compatible APIs Messages and token counting, with model-aware direct routing
Responses WebSocket Native transport gated by explicit live ws:/responses metadata
Routing Direct routes are preferred; bounded translation is used only where intent can be preserved
Operations Client setup, model inspection, health diagnosis, service management, and a diagnostics dashboard

Capability availability depends on the current Copilot account, model, endpoint, and transport. Read Protocol compatibility for contracts and limitations, and Capability validation for what to validate, how to run it, and how to interpret the result.

Product boundary

Topology Support
One trusted user on local loopback Supported
Private backend behind an authenticated gateway Conditional; the gateway must provide the missing security and governance controls
Direct team sharing Unsupported
Public multi-tenant service Unsupported

The proxy deliberately keeps one Copilot identity and its runtime state in one process. It is not a multi-tenant gateway. See Product support for the full rationale.

Documentation

Use the documentation index to continue by task. Security boundaries and private vulnerability reporting are documented in the security policy.

Development

Source development requires Bun >= 1.3.6.

bun install --frozen-lockfile
bun run dev
bun run build
bun run typecheck
bun run lint
bun test
bun run test:coverage
bun run knip
bun run audit

Use the targeted and live validation commands documented in Capability validation when changing upstream-gated behavior.

Acknowledgments

Originally based on ericc-ch/copilot-api; the codebase has since been comprehensively rebuilt.

Comments (0)

Sign in to join the discussion.

No comments yet

Be the first to share your take.