copilot-api transforms GitHub Copilot into an API-compatible server that mimics OpenAI and Anthropic interfaces, making Copilot's capabilities accessible to applications designed for these popular LLM APIs. This allows tools like Claude Code to leverage GitHub Copilot directly. The package is currently at version 0.7.0 and receives frequent updates, often with minor feature additions and bug fixes, as seen in recent patch and minor releases. Its key differentiator is bridging GitHub Copilot's proprietary access with standard API formats, offering flexibility for developers who want to integrate Copilot into existing LLM toolchains without vendor lock-in to GitHub's specific integration methods. It runs as a standalone server, typically invoked via `npx`.
npm install copilot-apiVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to programmatically start the Copilot API server within a Node.js application, allowing for custom configuration beyond CLI arguments and illustrating basic setup.
To enable proxy support from environment variables, you must explicitly use the `--proxy-env` flag when starting the server via CLI (e.g., `npx copilot-api start --proxy-env`) or set `useProxyEnv: true` in programmatic configurations.
Ensure your project is configured for ESM (e.g., by setting `"type": "module"` in `package.json` or using `.mjs` file extensions) and use `import` statements for programmatic access.
Verify that GitHub Copilot is installed and logged in on the machine running the `copilot-api` server. This typically involves having VS Code with the Copilot extension or the GitHub CLI with Copilot features enabled and authenticated.
Switch to ES module `import` syntax (e.g., `import { startServer } from 'copilot-api'`) and ensure your Node.js project or file is configured for ESM.Restart the `copilot-api` server with the `--proxy-env` flag (e.g., `npx copilot-api@latest start --proxy-env`) or ensure `useProxyEnv: true` is passed in programmatic configurations.
Ensure that GitHub Copilot is actively running and authenticated on your system (e.g., via VS Code or GitHub CLI) before starting the `copilot-api` server.
No dependency data recorded yet.