> ## Documentation Index
> Fetch the complete documentation index at: https://copilot-api.nick3.top/llms.txt
> Use this file to discover all available pages before exploring further.

# Copilot API: GitHub Copilot as a compatible API server

> Copilot API is a local proxy that exposes your GitHub Copilot subscription as an OpenAI and Anthropic compatible server for any AI coding tool.

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)

<Warning>
  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](https://docs.github.com/site-policy/acceptable-use-policies/github-acceptable-use-policies) before using this proxy in automated workflows.
</Warning>

## Get started

<CardGroup cols={2}>
  <Card title="Quickstart" icon="bolt" href="/quickstart">
    Authenticate, start the proxy, and make your first API call in a few minutes.
  </Card>

  <Card title="Authentication" icon="key" href="/authentication">
    Learn how GitHub OAuth works, manage multiple accounts, and protect the proxy with API keys.
  </Card>

  <Card title="Claude Code" icon="terminal" href="/integrations/claude-code">
    Configure Claude Code to use Copilot as its AI backend.
  </Card>

  <Card title="OpenCode" icon="code" href="/integrations/opencode">
    Point OpenCode at the proxy via the Anthropic SDK provider.
  </Card>
</CardGroup>
