
Security News
PolinRider: North Korea-Linked Supply Chain Campaign Expands Across Open Source Ecosystems
PolinRider expands across npm, Packagist, Go modules, and Chrome extensions, using hidden loaders to target developer environments.
xc-copilot-api
Advanced tools
Turn GitHub Copilot into OpenAI/Anthropic API compatible server. Usable with Claude Code and Codex
Fork Notice:
The original project by ericc-ch is no longer actively maintained. This fork by billxc updates the project for personal use, adding native passthrough support for the Responses API and Claude API.
[!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. Use this proxy responsibly to avoid account restrictions.
A reverse-engineered proxy for the GitHub Copilot API that exposes it as an OpenAI and Anthropic compatible service. Use GitHub Copilot with Claude Code, Codex CLI, or any tool that supports the OpenAI / Anthropic API.
Note: If you are using opencode, you do not need this project. Opencode supports GitHub Copilot provider out of the box.
# 1. Start the server
npx xc-copilot-api@latest start
# 2. Configure your tool
npx xc-copilot-api@latest config --claude # Claude Code (Opus 4.7)
npx xc-copilot-api@latest config --codex # Codex CLI (GPT-5.5)
That's it. Your tool is now powered by GitHub Copilot.
https://github.com/user-attachments/assets/7654b383-669d-4eb9-b23c-06d7aefee8c5
/v1/chat/completions, /v1/responses, /v1/messages, /v1/embeddings, /v1/modelsconfig --claude / config --codex writes the right settings automatically--rate-limit and --wait to stay within GitHub's limits# Opus 4.7 (default)
npx xc-copilot-api@latest config --claude
# Opus 4.6
npx xc-copilot-api@latest config --claude -m 4.6
A backup of your existing config is saved as settings.json.bak.
Opus 4.7 (default):
{
"env": {
"ANTHROPIC_BASE_URL": "http://localhost:4141",
"ANTHROPIC_AUTH_TOKEN": "Powered by xc copilot",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-4.7-1m-internal",
"CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS": "1"
}
}
Opus 4.6:
{
"env": {
"ANTHROPIC_BASE_URL": "http://localhost:4141",
"ANTHROPIC_AUTH_TOKEN": "Powered by xc copilot",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-4.6-1m",
"CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS": "1"
}
}
More options: Claude Code settings · IDE integration
npx xc-copilot-api@latest config --codex
Add to ~/.codex/config.toml:
model = "gpt-5.5"
model_provider = "copilot-api"
[model_providers.copilot-api]
name = "copilot-api"
base_url = "http://localhost:4141/v1"
wire_api = "responses"
| Command | Description |
|---|---|
start | Start the API server (handles auth automatically) |
auth | Run GitHub auth flow only (for generating tokens for CI/CD) |
config | Configure Claude Code or Codex CLI to use this proxy |
check-usage | Show Copilot usage and quota in the terminal |
debug | Display version, runtime, file paths, and auth status |
start Options| Option | Description | Default | Alias |
|---|---|---|---|
| --port | Port to listen on | 4141 | -p |
| --verbose | Enable verbose logging | false | -v |
| --account-type | Account type (individual, business, enterprise) | individual | -a |
| --manual | Manually approve each request | false | |
| --rate-limit | Minimum seconds between requests | -r | |
| --wait | Wait instead of error when rate limited | false | -w |
| --github-token | Provide GitHub token directly | -g | |
| --show-token | Show tokens on fetch and refresh | false | |
| --proxy-env | Initialize proxy from environment variables | false |
config Options| Option | Description | Default | Alias |
|---|---|---|---|
| --claude | Configure Claude Code (~/.claude/settings.json) | false | -c |
| --codex | Configure Codex CLI (~/.codex/config.toml) | false | -x |
| --claude-model | Claude Opus model version (4.7 or 4.6) | 4.7 | -m |
| Endpoint | Description |
|---|---|
POST /v1/chat/completions | OpenAI Chat Completions API |
POST /v1/responses | OpenAI Responses API (native passthrough) |
POST /v1/messages | Anthropic Messages API (native passthrough) |
POST /v1/messages/count_tokens | Anthropic token counting |
GET /v1/models | List available models |
POST /v1/embeddings | Create embedding vectors |
GET /usage | Copilot usage statistics and quota |
GET /token | Current Copilot token |
# Install easy-service
uv tool install git+https://github.com/billxc/easy-service.git
# Install and start
easy-service install copilot-api -- npx -y xc-copilot-api@latest start
# Manage
easy-service status copilot-api
easy-service logs copilot-api -f
easy-service restart copilot-api
easy-service stop copilot-api
easy-service uninstall copilot-api
bun install # install dependencies
bun run dev # development mode
bun run start # production mode
Prerequisites: Bun >= 1.2.x, GitHub account with Copilot subscription.
--rate-limit 30 --wait to stay within Copilot's rate limits without client errors.--account-type business or enterprise if you have a business/enterprise Copilot plan. See official docs.--manual to approve each request individually for fine-grained control.docker pull ghcr.io/billxc/copilot-api:latest
mkdir -p ./copilot-data
docker run -p 4141:4141 -v $(pwd)/copilot-data:/root/.local/share/copilot-api ghcr.io/billxc/copilot-api:latest
Available tags: latest, v*.*.*, master, <sha>
docker build -t copilot-api .
mkdir -p ./copilot-data
docker run -p 4141:4141 -v $(pwd)/copilot-data:/root/.local/share/copilot-api copilot-api
docker run -p 4141:4141 -e GH_TOKEN=your_token copilot-api
version: "3.8"
services:
copilot-api:
image: ghcr.io/billxc/copilot-api:latest
ports:
- "4141:4141"
environment:
- GH_TOKEN=your_github_token_here
volumes:
- ./copilot-data:/root/.local/share/copilot-api
restart: unless-stopped
Note: Token data is persisted in
copilot-dataon your host, mapped to/root/.local/share/copilot-apiinside the container.
--claude-model (-m) option for config --claude. Choose between Opus 4.7 (default) and Opus 4.6.config --codex now defaults to gpt-5.5.image_generation and other unsupported tool types before forwarding to upstream, preventing errors from Codex CLI.idleTimeout to 255s to prevent streaming responses from being cut off after 10 seconds.config subcommand: One-command setup for Claude Code (config --claude) and Codex CLI (config --codex).claude-opus-4.6-1m and other 1M context models./v1/messages still use the Anthropic-to-OpenAI translation layer.FAQs
Turn GitHub Copilot into OpenAI/Anthropic API compatible server. Usable with Claude Code and Codex
The npm package xc-copilot-api receives a total of 10 weekly downloads. As such, xc-copilot-api popularity was classified as not popular.
We found that xc-copilot-api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
PolinRider expands across npm, Packagist, Go modules, and Chrome extensions, using hidden loaders to target developer environments.

Security News
Open source attacks are accelerating as AI coding agents pull in dependencies faster, with less human review.

Research
/Security News
Malicious Chrome and Firefox extensions posed as free VPNs while stealing clipboard data through later extension updates.