copilot-api  by yuegongzi

GitHub Copilot API proxy for OpenAI and Anthropic compatibility

Created 3 months ago
285 stars

Top 91.7% on SourcePulse

GitHubView on GitHub
Project Summary

Summary This project provides a reverse-engineered proxy for the GitHub Copilot API, exposing it as a compatible service for OpenAI and Anthropic APIs. It enables developers to integrate Copilot's coding assistance into tools supporting these standard protocols, expanding its utility across diverse AI applications.

How It Works A Dockerized Hono server acts as an intermediary, translating requests between OpenAI/Anthropic formats and the GitHub Copilot API. It features request translation, state management, GitHub OAuth device flow for account management, and rate limiting, allowing clients like Claude Code to seamlessly interact with Copilot.

Quick Start & Requirements Deployment uses Docker Compose (docker compose up -d) or docker run. A GitHub account with Copilot is required. Access http://localhost:4141/admin post-start to add accounts via GitHub OAuth device flow.

Highlighted Details

  • OpenAI/Anthropic Compatibility: Supports /v1/chat/completions, /v1/models, /v1/embeddings (OpenAI), and /v1/messages (Anthropic).
  • Multi-Account Management: Web UI (/admin) for adding, switching, and managing multiple GitHub accounts.
  • Docker-First Deployment: Optimized for containers with persistent configuration storage.
  • Usage Monitoring: /usage endpoint displays Copilot API usage and quota.
  • Rate Limiting: Configurable rate limiting with request queuing option.
  • Tool Support: Best-effort compatibility for standard function tools and common Copilot built-in tools.

Maintenance & Community A fork of ericc-ch/copilot-api, maintained by yuegongzi/copilot-api after the original project's maintenance ceased. No specific community channels or contributor details are provided.

Licensing & Compatibility License not stated. It's a reverse-engineered proxy, "Use at your own risk." GitHub's Acceptable Use Policies apply; excessive automated use risks account suspension. Not officially supported by GitHub.

Limitations & Caveats May break with GitHub API changes. Excessive automation risks account suspension. Tool support is limited for complex agent frameworks. Upstream Copilot interaction accounting (e.g., subagents, warmup) can increase billable interactions, which this proxy cannot fully control.

Health Check
Last Commit

1 week ago

Responsiveness

Inactive

Pull Requests (30d)
4
Issues (30d)
15
Star History
118 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.