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

copilot-api-node20

v0.9.1

Published

Turn GitHub Copilot into OpenAI/Anthropic API compatible server. Usable with Claude Code! (Node v20+ fork)

Readme

🚀 Copilot API Proxy (Node 20+ Compatible)

Transform GitHub Copilot into OpenAI/Anthropic APIClaude Code ReadyOne Command Setup

npm version MIT License GitHub stars

Turn your existing GitHub Copilot subscription into a powerful OpenAI/Anthropic-compatible API server. Perfect for powering Claude Code, custom tools, and any application expecting OpenAI or Anthropic APIs.

✨ Why This Proxy?

  • 🎯 One Command Launch: Get Claude Code running with Copilot in seconds
  • 💰 Use What You Pay For: Leverage your existing Copilot subscription
  • 🔄 Dual API Support: Both OpenAI (/v1/chat/completions) and Anthropic (/v1/messages) endpoints
  • 📊 Usage Dashboard: Beautiful web interface to monitor your API usage
  • ⚡ Node 20+ Ready: Optimized fork with modern Node.js compatibility
  • 🛡️ Rate Limiting: Built-in controls to respect GitHub's limits

🎮 Quick Start with Claude Code

The fastest way to get Claude Code working with your Copilot subscription:

# 1. Launch the proxy with Claude Code integration
npx copilot-api-node20@latest start --claude-code

# 2. Follow the interactive setup (select your models)
# 3. Copy the generated command and run it in a new terminal
# 4. Start coding with Claude Code powered by your Copilot subscription! 🎉

That's it! Claude Code will now use your GitHub Copilot subscription instead of requiring separate API keys.


📋 Prerequisites

  • Node.js 20+ (this fork is optimized for modern Node versions)
  • GitHub account with active Copilot subscription (Individual, Business, or Enterprise)
  • No additional API keys needed! Uses your existing Copilot access

🚀 Installation & Usage

Option 1: NPX (Recommended)

# Quick start - launches server and opens usage dashboard
npx copilot-api-node20@latest start

# With Claude Code integration
npx copilot-api-node20@latest start --claude-code

# Custom port and verbose logging
npx copilot-api-node20@latest start --port 8080 --verbose

Option 2: Global Install

npm install -g copilot-api-node20
copilot-api start --claude-code

Option 3: Docker

# Build and run
docker build -t copilot-api .
docker run -p 4141:4141 -v $(pwd)/copilot-data:/root/.local/share/copilot-api copilot-api

# With environment variables
docker run -p 4141:4141 -e GH_TOKEN=your_token copilot-api

🎯 Core Features

🤖 Claude Code Integration

  • One-command setup with --claude-code flag
  • Interactive model selection or specify models directly
  • Automatic configuration - no manual JSON editing needed
  • Works out of the box with all Claude Code features

🔄 Dual API Compatibility

| OpenAI Format | Anthropic Format | Description | |---------------|------------------|-------------| | POST /v1/chat/completions | POST /v1/messages | Chat completions | | GET /v1/models | - | Available models | | POST /v1/embeddings | - | Text embeddings | | - | POST /v1/messages/count_tokens | Token counting |

📊 Usage Monitoring

  • Web Dashboard: Beautiful interface at /usage endpoint
  • Real-time Stats: Monitor quotas, requests, and usage patterns
  • Terminal Usage: Quick check with copilot-api check-usage

🛡️ Smart Rate Limiting

# Manual approval for each request
copilot-api start --manual

# 30-second minimum between requests
copilot-api start --rate-limit 30

# Wait instead of erroring on rate limits
copilot-api start --rate-limit 30 --wait

💡 Advanced Usage Examples

Claude Code with Specific Models

# Skip interactive setup - specify models directly
npx copilot-api-node20@latest start \
  --claude-code \
  --model "claude-sonnet-4" \
  --small-model "claude-sonnet-4"

Enterprise/Business Accounts

# For GitHub Business/Enterprise Copilot
npx copilot-api-node20@latest start --account-type business
npx copilot-api-node20@latest start --account-type enterprise

Production Deployment

# With comprehensive settings
npx copilot-api-node20@latest start \
  --port 8080 \
  --rate-limit 10 \
  --wait \
  --timeout 180000 \
  --account-type business

CI/CD Integration

# Authenticate separately for token reuse
npx copilot-api-node20@latest auth --show-token

# Use token in production
npx copilot-api-node20@latest start --github-token $GITHUB_TOKEN

🔧 Command Reference

Main Commands

| Command | Description | |---------|-------------| | start | Launch the API proxy server | | auth | Run GitHub authentication only | | check-usage | Show usage stats in terminal | | debug | Display diagnostic information |

Key Options

| Flag | Description | Example | |------|-------------|---------| | --claude-code | Generate Claude Code launch command | start --claude-code | | --model | Primary model for Claude Code | --model "claude-sonnet-4" | | --small-model | Fast model for background tasks | --small-model "claude-sonnet-4" | | --rate-limit | Seconds between requests | --rate-limit 30 | | --manual | Manual request approval | --manual | | --account-type | GitHub plan type | --account-type business |


🌐 API Endpoints

Once running (default: http://localhost:4141):

OpenAI Compatible

curl -X POST http://localhost:4141/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-4",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

Anthropic Compatible

curl -X POST http://localhost:4141/v1/messages \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-3-5-sonnet-20241022",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

Usage Dashboard

Open http://localhost:4141/usage in your browser for a beautiful usage monitoring interface.


⚠️ Important Notices

Reverse-Engineered Proxy: This tool reverse-engineers GitHub Copilot's API. It's not officially supported by GitHub and may break unexpectedly.

Rate Limiting: Excessive automated use may trigger GitHub's abuse detection. Use responsibly with appropriate rate limiting.

Terms of Service: Review GitHub's Acceptable Use Policies and Copilot Terms before use.


🙏 Attribution & License

This is a Node 20+ compatible fork of the original project by Erick Christian.

Original Repository: https://github.com/ericc-ch/copilot-api Original Package: copilot-api on npm

Full credit goes to Erick Christian for creating this amazing project. This fork exists solely to maintain Node 20+ compatibility and will be discontinued once the original package supports modern Node versions.

License

MIT License - see LICENSE file for details.

Support the Original Author

If this project helps you, consider supporting the original creator: ko-fi


🐛 Troubleshooting

Common Issues

  • Authentication Failed: Run copilot-api auth --verbose to debug
  • Rate Limited: Use --rate-limit and --wait flags
  • Node Version: Ensure Node.js 20+ is installed
  • Port Conflicts: Change port with --port 8080

Debug Information

# Get detailed diagnostic info
npx copilot-api-node20@latest debug --json

Need Help?


Made with ❤️ by the community • Original work by Erick Christian

⭐ Star this repo🐛 Report issues📖 Original repo