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

Published

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

Readme

copilot-api

npm version downloads Node.js GitHub Closed Source License: MIT

A proxy server that turns a GitHub Copilot subscription into fully compatible OpenAI and Anthropic API endpoints. Use Claude Code, Codex CLI, and any tool that speaks the API -- all through the Copilot plan you already pay for, no separate API keys required.


Table of Contents


Key Features

| Feature | Description | |:--|:--| | Full Claude Code support | All Claude models, streaming, extended thinking, and the complete 1M token context window | | Full Codex CLI support | Complete OpenAI Responses API implementation purpose-built for Codex CLI | | Web search | Optional Tavily-powered web search available to both Claude Code and Codex sessions | | Dual API compatibility | OpenAI Chat Completions, Anthropic Messages, and OpenAI Responses APIs side by side | | Zero configuration | Single command to start -- authenticates via GitHub device-code OAuth |


Quick Start

Prerequisites: Node.js 20+ (or Bun) and an active GitHub Copilot subscription.

Claude Code

Start the proxy with Claude Code mode:

npx copilot-api-node20@latest start --claude-code

On first run, you authenticate via GitHub device-code OAuth. Once authenticated, the proxy starts on http://localhost:4141 and prints a ready-to-paste command. In another terminal:

ANTHROPIC_BASE_URL=http://localhost:4141 claude

To skip the interactive model picker, specify models upfront:

npx copilot-api-node20@latest start \
  --claude-code \
  --model claude-opus-4.6-1m \
  --small-model claude-haiku-4.5

Codex CLI

Start the proxy with Codex mode:

npx copilot-api-node20@latest start --codex --model gpt-5.3-codex

Configure ~/.codex/config.toml:

model = "gpt-5.3-codex"
model_provider = "local"

[model_providers.local]
name = "Local Server"
base_url = "http://localhost:4141/v1"
env_key = "OPENAI_API_KEY"

Then run:

OPENAI_API_KEY=dummy codex

Web Search

Provide a Tavily API key to enable web search tool calls in both Claude Code and Codex sessions:

npx copilot-api-node20@latest start --claude-code --tavily-api-key <key>

Alternatively, set TAVILY_API_KEY as an environment variable. The proxy operates normally when no key is provided -- web search is simply unavailable.


API Endpoints

All endpoints are served at http://localhost:4141 by default.

| Method | Path | Compatibility | |:--|:--|:--| | POST | /v1/chat/completions | OpenAI Chat Completions | | POST | /v1/responses | OpenAI Responses API | | POST | /v1/messages | Anthropic Messages | | POST | /v1/messages/count_tokens | Anthropic Token Counting | | POST | /v1/embeddings | OpenAI Embeddings | | GET | /v1/models | OpenAI Models | All OpenAI-compatible routes are also available without the /v1/ prefix.


CLI Reference

Commands

| Command | Description | |:--|:--| | copilot-api start | Start the proxy server | | copilot-api auth | Authenticate with GitHub | | copilot-api check-usage | Display Copilot usage quota | | copilot-api debug | Print diagnostic information |

start Flags

--claude-code and --codex are mutually exclusive.

| Flag | Alias | Default | Description | |:--|:--|:--|:--| | --port | -p | 4141 | Port to listen on | | --claude-code | -c | | Enable Claude Code compatibility mode | | --codex | | | Enable Codex CLI compatibility mode | | --model | -m | | Primary model to use | | --small-model | -s | | Lightweight model for fast tasks (Claude Code) | | --rate-limit | -r | | Minimum seconds between requests | | --timeout | -t | 600000 | Request timeout in ms (default 10 min) | | --account-type | -a | individual | individual, business, or enterprise | | --github-token | -g | | Provide a GitHub token directly (skips OAuth) | | --show-token | | | Display tokens on fetch and refresh | | --tavily-api-key | | | Tavily API key for web search | | --verbose | -v | | Enable debug-level logging |


Telemetry

This tool collects anonymous usage telemetry via OpenTelemetry. Only operational metrics are collected -- request counts, latency, model usage, and error rates. No prompts, completions, or personal information is ever collected.

By using copilot-api, you agree to this telemetry data collection.


Closed Source

The source code is not publicly available.

This fork represents ~9 months of sustained engineering work -- bug fixes, new features, and hardening that go well beyond the original project. Keeping it closed-source protects that investment and ensures a single, well-maintained distribution.

The original open-source project is available at ericc-ch/copilot-api.


Notices

This project relies on reverse-engineered, undocumented GitHub APIs. It is not affiliated with or endorsed by GitHub, Microsoft, Anthropic, or OpenAI and may break without notice.


Attribution

Originally created by Erick Christian -- ericc-ch/copilot-api. His work built the foundation: authentication flow, API translation layer, and streaming implementation.

This fork has diverged significantly over ~9 months with extensive bug fixes and major new features -- Anthropic Messages API, OpenAI Responses API, Claude Code mode, Codex CLI support, web search integration, usage telemetry, and more. It is maintained as a separate project by johnib.


License

MIT