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

@onklave/copilot-api

v0.1.5

Published

Expose a GitHub Copilot account (github.com or *.ghe.com) as an OpenAI/Anthropic-compatible API server. Connect Claude Code to GitHub Enterprise Cloud Copilot.

Readme

@onklave/copilot-api

Expose a GitHub Copilot subscription as an OpenAI/Anthropic-compatible API server — including Copilot accounts on GitHub Enterprise Cloud with data residency (*.ghe.com). Point Claude Code (or any OpenAI/Anthropic-compatible client) at it and use your Copilot entitlement as the model backend.

This is an Onklave-maintained derivative of ericc-ch/copilot-api (forked at v0.7.0, commit 0ea08feb, MIT — see NOTICE). What it adds over upstream:

  • --github-host / $GH_HOST — authenticate against a GHE Cloud data-residency tenant (acme.ghe.com) instead of github.com. Device-flow login, the Copilot token exchange, and usage queries all route to the tenant.
  • Self-configuring inference endpoint — the Copilot token exchange returns per-tenant service endpoints; the server honours endpoints.api (e.g. https://copilot-api.acme.ghe.com) instead of assuming api.githubcopilot.com, so data-residency traffic stays regional.
  • Per-host credential storage — a github.com login and a tenant login coexist under ~/.local/share/onklave-copilot-api/.

Quickstart

npx @onklave/copilot-api start

First run walks you through GitHub device-flow login, then serves on http://localhost:4141.

GitHub Enterprise Cloud (*.ghe.com)

# One-time login against your tenant
npx @onklave/copilot-api auth --github-host acme.ghe.com

# Run the server against the tenant (or: export GH_HOST=acme.ghe.com)
npx @onklave/copilot-api start --github-host acme.ghe.com

If your tenant blocks the device flow, generate an OAuth token on the tenant and pass it with --github-token instead.

Corporate proxies: the standard HTTPS_PROXY/HTTP_PROXY/NO_PROXY environment variables are honoured automatically by every command — no flag needed. If auth times out connecting to your tenant on a managed machine, check env | grep -i proxy and make sure your proxy variables are set in that shell.

Connecting Claude Code

Interactive — pick models and get a ready-to-paste launch command:

npx @onklave/copilot-api start --github-host acme.ghe.com --claude-code

Manual:

export ANTHROPIC_BASE_URL=http://localhost:4141
export ANTHROPIC_AUTH_TOKEN=dummy
# Optional — pin models; without these, unknown claude-* IDs are
# auto-mapped to your account's models (see Model mapping below)
export ANTHROPIC_MODEL=claude-sonnet-5
export ANTHROPIC_SMALL_FAST_MODEL=claude-haiku-4.5
claude

The server implements Anthropic's /v1/messages (streaming and count_tokens included) plus OpenAI-style /v1/chat/completions, /v1/models, and /v1/embeddings.

Model mapping: Claude Code's default settings request Anthropic's own model IDs (e.g. claude-haiku-4-5-20251001 for background calls), which Copilot serves under different names (claude-haiku-4.5). When a requested claude-* model isn't in your account's model list, the server automatically substitutes the same family — haiku-class requests get the available haiku model, everything else gets the strongest non-haiku Claude — and logs the substitution. Claude Code therefore works with no model configuration at all; pin exact models with the --claude-code picker or the ANTHROPIC_MODEL/ANTHROPIC_SMALL_FAST_MODEL env vars if you want control.

Commands and flags

| Command | Purpose | | --- | --- | | start | Run the API server (default port 4141) | | auth | Device-flow login only | | check-usage | Show Copilot quota/usage for the account | | debug | Print version, paths, and token status |

Key start flags (see --help for all): --port, --github-host, --account-type individual|business|enterprise, --github-token, --claude-code, --rate-limit <s> (+ --wait), --manual (approve each request), --proxy-env.

All commands accept --github-host; when omitted, $GH_HOST is used, then github.com.

Quota/usage for the signed-in account is served as JSON at http://localhost:4141/usage (same data as check-usage).

Caveats

  • This uses Copilot's internal editor API (reverse-engineered, as upstream). It is not a GitHub-supported integration surface; use it with your own account, within your organization's policies and GitHub's terms.
  • Excessive automated traffic can trip Copilot abuse detection — consider --rate-limit for agent workloads.
  • Requires Node >= 20.

Development

Self-contained package (own package-lock.json, not part of the monorepo's Nx graph):

npm install
npm run typecheck && npm test && npm run build
node dist/main.js start

Published to npm by .github/workflows/publish-libs.yaml on merge to main.

License

Apache-2.0 (see LICENSE). Derived from MIT-licensed ericc-ch/copilot-api; the original license and copyright are preserved in NOTICE.