Skip to main content
Copilot API is a proxy server that exposes GitHub Copilot as an OpenAI-compatible and Anthropic-compatible API. Point Claude Code, OpenCode, or any tool that speaks the OpenAI Chat Completions or Anthropic Messages API at http://localhost:4141 and start using your existing Copilot subscription immediately.

Quick Start

Run the proxy in under two minutes using npx — no build step required.

Authentication

Authenticate with GitHub OAuth or provide a token directly.

Claude Code

Configure Claude Code to use Copilot as its AI backend.

OpenCode

Point OpenCode at the proxy via the Anthropic SDK provider.

API Endpoints

Full reference for OpenAI-compatible and Anthropic-compatible endpoints.

Configuration

Customize models, API keys, rate limits, and more via config.json.

How it works

Copilot API sits between your AI tools and GitHub Copilot. It translates OpenAI and Anthropic requests into Copilot API calls, handles authentication token refresh automatically, and streams responses back in the format your tool expects.
1

Install and authenticate

Run npx @nick3/copilot-api@latest auth to authenticate your GitHub account through the standard OAuth device flow.
2

Start the proxy

Run npx @nick3/copilot-api@latest start to launch the local proxy server on port 4141.
3

Point your tool at the proxy

Set your AI tool’s base URL to http://localhost:4141 and use any placeholder value as the API key (unless you configure API key auth).
4

Use your Copilot subscription

Your tool now routes requests through Copilot. Monitor usage in the built-in Admin UI at http://localhost:4141/admin.
Copilot API is a reverse-engineered proxy and is not supported by GitHub. Excessive automated or bulk use of Copilot may trigger GitHub’s abuse-detection systems. Use responsibly and review GitHub’s Acceptable Use Policies.