Turn GitHub Copilot into OpenAI/Anthropic API compatible server. Usable with Claude Code! (Node v20+ fork)
npm install copilot-api-node20> Transform GitHub Copilot into OpenAI/Anthropic API • Claude Code Ready • One Command Setup



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.
- 🎯 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
---
The fastest way to get Claude Code working with your Copilot subscription:
``bash1. Launch the proxy with Claude Code integration
npx copilot-api-node20@latest start --claude-code
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
$3
`bash
Quick start - launches server and opens usage dashboard
npx copilot-api-node20@latest startWith Claude Code integration
npx copilot-api-node20@latest start --claude-codeCustom port and verbose logging
npx copilot-api-node20@latest start --port 8080 --verbose
`$3
`bash
npm install -g copilot-api-node20
copilot-api start --claude-code
`$3
`bash
Build and run
docker build -t copilot-api .
docker run -p 4141:4141 -v $(pwd)/copilot-data:/root/.local/share/copilot-api copilot-apiWith environment variables
docker run -p 4141:4141 -e GH_TOKEN=your_token copilot-api
`---
🎯 Core Features
$3
- 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$3
| 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 |$3
- 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$3
`bash
Manual approval for each request
copilot-api start --manual30-second minimum between requests
copilot-api start --rate-limit 30Wait instead of erroring on rate limits
copilot-api start --rate-limit 30 --wait
`---
💡 Advanced Usage Examples
$3
`bash
Skip interactive setup - specify models directly
npx copilot-api-node20@latest start \
--claude-code \
--model "claude-sonnet-4" \
--small-model "claude-sonnet-4"
`$3
`bash
For GitHub Business/Enterprise Copilot
npx copilot-api-node20@latest start --account-type business
npx copilot-api-node20@latest start --account-type enterprise
`$3
`bash
With comprehensive settings
npx copilot-api-node20@latest start \
--port 8080 \
--rate-limit 10 \
--wait \
--timeout 180000 \
--account-type business
`$3
`bash
Authenticate separately for token reuse
npx copilot-api-node20@latest auth --show-tokenUse token in production
npx copilot-api-node20@latest start --github-token $GITHUB_TOKEN
`---
🔧 Command Reference
$3
| Command | Description |
|---------|-------------|
|
start | Launch the API proxy server |
| auth | Run GitHub authentication only |
| check-usage | Show usage stats in terminal |
| debug | Display diagnostic information |$3
| 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):$3
`bash
curl -X POST http://localhost:4141/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-4",
"messages": [{"role": "user", "content": "Hello!"}]
}'
`$3
`bash
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!"}]
}'
`$3
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:
Original Package:
copilot-api on npmFull 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.
$3
MIT License - see LICENSE file for details.
$3
If this project helps you, consider supporting the original creator:

---
🐛 Troubleshooting
$3
- 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$3
`bash
Get detailed diagnostic info
npx copilot-api-node20@latest debug --json
``- Check the original repository for issues and discussions
- Review Claude Code documentation for integration help
---
Made with ❤️ by the community • Original work by Erick Christian