Copilot API Proxy
[!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]
opencode already ships with a built-in GitHub Copilot provider, so you may not need this project for basic usage. This proxy is still useful if you want OpenCode to talk to Copilot through @ai-sdk/anthropic, preserve Anthropic Messages semantics for tool use, prefer the native Messages API over plain Chat Completions for Claude-family models, use gpt-5.4 phase-aware commentary, or fine-tune premium-request usage with small-model fallbacks.
Project Overview
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 to power Claude Code.
Compared with routing everything through plain Chat Completions compatibility, this proxy can prefer Copilot's native Anthropic-style Messages API for Claude-family models, preserve more native thinking/tool semantics, reduce unnecessary Premium request consumption on warmup or resumed tool turns, and expose phase-aware gpt-5.4 / gpt-5.3-codex responses that are easier for users to follow.
Features
- OpenAI & Anthropic Compatibility: Exposes GitHub Copilot as an OpenAI-compatible (
/v1/responses, /v1/chat/completions, /v1/models, /v1/embeddings) and Anthropic-compatible (/v1/messages) API.
- Anthropic-First Routing for Claude Models: When a model supports Copilot's native
/v1/messages endpoint, the proxy prefers it over /responses or /chat/completions, preserving Anthropic-style tool_use / tool_result flows and more Claude-native behavior.
- Fewer Unnecessary Premium Requests: Reduces wasted premium usage by routing warmup and compact/background requests to
smallModel, merging tool_result follow-ups back into the tool flow, and treating resumed tool turns as continuation traffic instead of fresh premium interactions.
- Phase-Aware
gpt-5.4 and gpt-5.3-codex: These models can emit user-friendly commentary before deeper reasoning or tool use, so long-running coding actions are easier to understand instead of appearing as a sudden tool burst.
- Claude Native Beta Support: On the Messages API path, supports Anthropic-native capabilities such as
interleaved-thinking, advanced-tool-use, and context-management, which are difficult or unavailable through plain Chat Completions compatibility.
- Subagent Marker Integration: Optional Claude Code and opencode plugins can inject
__SUBAGENT_MARKER__... and propagate x-session-id so subagent traffic keeps the correct root session and agent/user semantics.
- OpenCode via
@ai-sdk/anthropic: Point OpenCode at this proxy as an Anthropic provider so Anthropic Messages semantics, premium-request optimizations, and Claude-native behavior are preserved end to end.
- Claude Code Integration: Easily configure and launch Claude Code to use Copilot as its backend with a simple command-line flag (
--claude-code).
- Usage Dashboard: A web-based dashboard to monitor your Copilot API usage, view quotas, and see detailed statistics.
- Rate Limit Control: Manage API usage with rate-limiting options (
--rate-limit) and a waiting mechanism (--wait) to prevent errors from rapid requests.
- Manual Request Approval: Manually approve or deny each API request for fine-grained control over usage (
--manual).
- Token Visibility: Option to display GitHub and Copilot tokens during authentication and refresh for debugging (
--show-token).
- Flexible Authentication: Authenticate interactively or provide a GitHub token directly, suitable for CI/CD environments.