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

@daomar/copilot-api

v0.9.0

Published

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

Readme

Copilot API Proxy

What is this?

A small local server that lets you use your GitHub Copilot subscription as the backend for AI coding tools like Codex CLI and Claude Code.

It exposes Copilot through OpenAI- and Anthropic-compatible APIs, so those tools talk to the proxy instead of paying for separate API keys. The proxy logs in once and refreshes your Copilot token automatically.

Requirements

  • A GitHub account with an active Copilot subscription (individual, business, or enterprise)
  • Node.js 20+ (so you can run npx)

Quick start

On any machine, run a single command:

npx @daomar/copilot-api@latest setup

This will:

  1. Log you in to GitHub (it shows a code to enter in your browser). You only do this once per machine.
  2. Configure your tools — it writes config for Codex CLI and Claude Code so they use the proxy. The config files are created even if those tools aren't installed yet, so they'll just work once you install them. Existing settings are kept (and backed up to *.bak).
  3. Run it in the background, always — it installs a service that starts on boot and restarts if it crashes, listening on http://localhost:4141:
    • Linux — a systemd user service
    • Windows — a Scheduled Task (CopilotAPI) that runs hidden (no console window)

That's it. Open Codex or Claude Code and they'll use your Copilot subscription.

Setup questions

setup asks a few questions; press Enter to accept the defaults:

  • Account typeindividual, business, or enterprise (match your Copilot plan)
  • Port — defaults to 4141
  • Which tools to configure — Codex, Claude Code, or both
  • Which models to use
  • Whether to install the background service

To skip all questions and accept defaults:

npx @daomar/copilot-api@latest setup --yes --account-type enterprise

Re-running setup any time is safe — it updates your config and refreshes the service.

Using your tools

After setup, just use the tools as normal:

  • Codex CLIcodex uses the copilot provider on port 4141. Note the GPT‑5.x codex models (e.g. gpt-5.5, gpt-5.3-codex) are served here too.
  • Claude Codeclaude is pointed at the proxy via ~/.claude/settings.json.

To change the model later, edit ~/.codex/config.toml (Codex) or ~/.claude/settings.json (Claude Code), or just re-run setup.

Managing the background service

Linux (systemd):

systemctl --user status copilot-api     # check status
systemctl --user restart copilot-api    # restart
systemctl --user stop copilot-api       # stop
systemctl --user disable --now copilot-api   # remove from startup

Windows (Task Scheduler): manage the CopilotAPI task in the Task Scheduler app, or:

schtasks /Run /TN CopilotAPI      # start now
schtasks /End /TN CopilotAPI      # stop
schtasks /Delete /TN CopilotAPI /F  # remove

Other commands

You usually only need setup, but these are available via npx @daomar/copilot-api@latest <command>:

| Command | What it does | | ------------- | ---------------------------------------------------------------------------- | | setup | Guided login + configure tools + install the background service (recommended) | | start | Run the proxy in the foreground (e.g. start --port 4141) | | config | Just write/update the Codex and Claude Code config files (no service) | | auth | Just log in to GitHub | | check-usage | Show your Copilot usage and quota in the terminal | | debug | Show diagnostic info for troubleshooting |

Useful start / setup options: --port <n> (default 4141), --account-type <individual|business|enterprise>, --codex / --claude (configure only one), --no-service (setup without the background service).

Configure manually (optional)

If you'd rather not use setup, you can point the tools at a running proxy yourself.

Codex CLI — add to ~/.codex/config.toml:

model = "gpt-5.5"
model_provider = "copilot"

[model_providers.copilot]
name = "GitHub Copilot"
base_url = "http://localhost:4141/v1"
wire_api = "responses"
requires_openai_auth = false
http_headers = { "Openai-Intent" = "conversation-edits", "x-initiator" = "user" }

Claude Code — add to ~/.claude/settings.json:

{
  "env": {
    "ANTHROPIC_BASE_URL": "http://localhost:4141",
    "ANTHROPIC_AUTH_TOKEN": "dummy"
  }
}

You don't need to set any ANTHROPIC_*_MODEL variables — the proxy automatically maps whatever model Claude Code requests (Opus/Sonnet/Haiku) to an available Copilot model. If you do want to pin a specific model, use Claude Code's normal model names (e.g. claude-sonnet-4-5), not Copilot's dotted ids.

Then run npx @daomar/copilot-api@latest start.

Monitor your usage

See your Copilot quota and usage anytime:

npx @daomar/copilot-api@latest check-usage

Or open the web dashboard: https://ericc-ch.github.io/copilot-api?endpoint=http://localhost:4141/usage (while the proxy is running).

Troubleshooting

  • Run npx @daomar/copilot-api@latest debug to see version, paths, and login status.
  • Port already in use? Pick another with setup --port 5151 (and re-run your tools' config, or just re-run setup).
  • Need to log in again? Run npx @daomar/copilot-api@latest auth.