Marketplace for optional Claude Code plugin helpers used with copilot-api.
npx claudepluginhub yuegongzi/copilot-apiInject SubagentStart marker context for copilot-api initiator override.
Share bugs, ideas, or general feedback.
English | 中文
[!NOTE] About This Fork This project is forked from ericc-ch/copilot-api. Since the original author has discontinued maintenance and no longer supports the new API, we have redesigned and rewritten it. Special thanks to @ericc-ch for the original work and contribution!
[!WARNING] This is a reverse-engineered proxy of GitHub Copilot API. It is not supported by GitHub, and may break unexpectedly. Use at your own risk.
[!WARNING] GitHub Security Notice:
Excessive automated or scripted use of Copilot (including rapid or bulk requests, such as via automated tools) may trigger GitHub's abuse-detection systems.
You may receive a warning from GitHub Security, and further anomalous activity could result in temporary suspension of your Copilot access.GitHub prohibits use of their servers for excessive automated bulk activity or any activity that places undue burden on their infrastructure.
Please review:
Use this proxy responsibly to avoid account restrictions.
Note: If you are using opencode, you do not need this project. Opencode supports GitHub Copilot provider out of the box.
A reverse-engineered proxy for the GitHub Copilot API that exposes it as an OpenAI and Anthropic compatible service. This allows you to use GitHub Copilot with any tool that supports the OpenAI Chat Completions API or the Anthropic Messages API, including Claude Code.
flowchart TB
subgraph Clients["Client Applications"]
CC[Claude Code]
OC[OpenCode]
OTHER[Other OpenAI/Anthropic Compatible Tools]
end
subgraph Proxy["Copilot API Proxy (Docker)"]
direction TB
SERVER[Hono Server :4141]
subgraph Routes["API Routes"]
ANTHROPIC["/v1/messages<br/>Anthropic API"]
OPENAI["/v1/chat/completions<br/>OpenAI API"]
RESPONSES["/v1/responses<br/>OpenAI Responses API"]
MODELS["/v1/models"]
EMBED["/v1/embeddings"]
end
subgraph Admin["Management"]
ADMIN_UI["/admin<br/>Web UI"]
USAGE["/usage"]
TOKEN_EP["/token"]
end
subgraph Core["Core Components"]
TRANSLATOR[Request Translator]
STATE[State Manager]
ACCOUNTS[Account Manager]
RATE[Rate Limiter]
end
subgraph Storage["Persistent Storage"]
CONFIG[("/data/copilot-api/config.json")]
end
end
subgraph GitHub["GitHub Services"]
GH_OAUTH[GitHub OAuth<br/>Device Flow]
GH_COPILOT[GitHub Copilot API]
end
CC --> |Anthropic Protocol| ANTHROPIC
OC --> |OpenAI Protocol| OPENAI
OTHER --> |OpenAI/Anthropic| Routes
ANTHROPIC --> TRANSLATOR
OPENAI --> TRANSLATOR
RESPONSES --> TRANSLATOR
TRANSLATOR --> RATE
RATE --> STATE
STATE --> GH_COPILOT
ADMIN_UI --> ACCOUNTS
ACCOUNTS --> GH_OAUTH
ACCOUNTS --> CONFIG
STATE --> CONFIG
GH_COPILOT --> |Response| TRANSLATOR
TRANSLATOR --> |Translated Response| Clients
sequenceDiagram
participant Client as Claude Code / Client
participant Proxy as Copilot API Proxy
participant GitHub as GitHub Copilot API
Note over Client,GitHub: Initial Setup (via /admin)
Proxy->>GitHub: OAuth Device Flow
GitHub-->>Proxy: Access Token
Proxy->>Proxy: Store in config.json
Note over Client,GitHub: API Request Flow
Client->>Proxy: POST /v1/messages (Anthropic format)
Proxy->>Proxy: Translate to Copilot format
Proxy->>Proxy: Check rate limit
Proxy->>GitHub: Forward request
GitHub-->>Proxy: Copilot response
Proxy->>Proxy: Translate to Anthropic format
Proxy-->>Client: Anthropic-compatible response