npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

xc-copilot-api

v1.2.5

Published

Turn GitHub Copilot into OpenAI/Anthropic API compatible server. Usable with Claude Code and Codex

Readme

Copilot API Proxy

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.

Quick Start

# 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.

Demo

https://github.com/user-attachments/assets/7654b383-669d-4eb9-b23c-06d7aefee8c5

Features

  • OpenAI & Anthropic Compatibility/v1/chat/completions, /v1/responses, /v1/messages, /v1/embeddings, /v1/models
  • Native Passthrough — Claude and GPT models are forwarded directly to upstream with full protocol fidelity (tool use, streaming, thinking blocks, vision)
  • One-command Setupconfig --claude / config --codex writes the right settings automatically
  • Usage Dashboard — Web UI to monitor quotas and usage statistics
  • Rate Limiting--rate-limit and --wait to stay within GitHub's limits
  • Background Service — Run as a system service via easy-service
  • Multiple Account Types — Individual, business, and enterprise Copilot plans

Using with Claude Code

# 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

Using with Codex CLI

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 Reference

Commands

| 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 |

API Endpoints

| 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 |

Running as a Background Service

# 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

Running from Source

bun install        # install dependencies
bun run dev        # development mode
bun run start      # production mode

Prerequisites: Bun >= 1.2.x, GitHub account with Copilot subscription.

Usage Tips

  • Use --rate-limit 30 --wait to stay within Copilot's rate limits without client errors.
  • Use --account-type business or enterprise if you have a business/enterprise Copilot plan. See official docs.
  • Use --manual to approve each request individually for fine-grained control.

Pre-built Image

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>

Build from Source

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

Environment Variables

docker run -p 4141:4141 -e GH_TOKEN=your_token copilot-api

Docker Compose

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-data on your host, mapped to /root/.local/share/copilot-api inside the container.

v1.2.3 — Claude Model Selection & Codex 5.5

  • Claude model version selection: New --claude-model (-m) option for config --claude. Choose between Opus 4.7 (default) and Opus 4.6.
  • Codex default model updated: config --codex now defaults to gpt-5.5.
  • Filter unsupported tools in Responses API: Automatically strips image_generation and other unsupported tool types before forwarding to upstream, preventing errors from Codex CLI.
  • Bun idle timeout fix: Increased idleTimeout to 255s to prevent streaming responses from being cut off after 10 seconds.
  • README restructured: Quick Start first, collapsible Docker/Update Log sections, consolidated command reference.

v1.2.1 — easy-service & Config Command

  • New config subcommand: One-command setup for Claude Code (config --claude) and Codex CLI (config --codex).
  • Background service: Replaced built-in daemon with easy-service for cross-platform service management.

v1.1.x — Anthropic 1M Models

  • Anthropic 1M model support: Enhanced beta header handling for claude-opus-4.6-1m and other 1M context models.

v1.0.x — Native Passthrough

  • Native passthrough for Responses API and Claude API: Claude models forward the entire Anthropic Messages request directly to upstream. GPT models forward Responses API requests without transformation.
  • Full protocol fidelity: Tool use, streaming, thinking blocks, vision — all preserved without translation loss.
  • Fallback translation: Non-Claude models hitting /v1/messages still use the Anthropic-to-OpenAI translation layer.