Skip to main content
Copilot API is a reverse-engineered proxy that makes your existing GitHub Copilot subscription available as a standard API. It listens on http://localhost:4141 and translates requests from tools like Claude Code, OpenCode, or any OpenAI- or Anthropic-compatible client into Copilot API calls — no separate API key or billing account required beyond what you already pay for Copilot.

What Copilot API does

When you start the proxy, it authenticates with GitHub on your behalf and handles all token management automatically. Your AI tools connect to http://localhost:4141 as if it were a hosted API, and the proxy forwards their requests to GitHub Copilot, translates the responses, and streams them back.

API compatibility

Copilot API exposes three compatibility layers:
  • OpenAI Chat Completions (POST /v1/chat/completions) — works with any tool that supports the OpenAI API
  • OpenAI Responses API (POST /v1/responses) — the more capable OpenAI interface for agentic workflows
  • Anthropic Messages API (POST /v1/messages) — native Anthropic-style requests for Claude models

Native Anthropic routing for Claude models

For Claude-family models, the proxy prefers Copilot’s native /v1/messages endpoint over the Chat Completions compatibility path. This preserves Anthropic-native behavior including interleaved-thinking, advanced-tool-use, and context-management betas, and reduces unnecessary premium request consumption on tool-heavy workflows.

Multi-account support

You can register more than one GitHub account. Premium model requests use accounts in order and fall back automatically when quota is exhausted. Free model requests are distributed round-robin across accounts by default.

Admin UI and usage dashboard

A built-in web interface at http://localhost:4141/admin lets you inspect account status, browse request history, filter by model or endpoint, and view detailed per-request JSON. No external service required — everything is stored locally in SQLite.

Who it’s for

Copilot API is aimed at developers who already have a GitHub Copilot subscription (individual, business, or enterprise) and want to use that subscription with AI coding tools that expect an OpenAI or Anthropic compatible endpoint.

Prerequisites

  • A GitHub account with an active Copilot subscription (individual, business, or enterprise)
  • Node.js >= 20 or Bun >= 1.2.x (for running via npx or from source)
Copilot API is a reverse-engineered proxy and is not officially supported by GitHub. It may break without notice if GitHub changes their API. Excessive automated or bulk use of Copilot may trigger GitHub’s abuse-detection systems and could result in temporary suspension of your Copilot access. Review GitHub’s Acceptable Use Policies before using this proxy in automated workflows.

Get started

Quickstart

Authenticate, start the proxy, and make your first API call in a few minutes.

Authentication

Learn how GitHub OAuth works, manage multiple accounts, and protect the proxy with API keys.

Claude Code

Configure Claude Code to use Copilot as its AI backend.

OpenCode

Point OpenCode at the proxy via the Anthropic SDK provider.