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 tohttp://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 athttp://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
npxor from source)
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.