Skip to content

v1.0.0

Choose a tag to compare

@XSRQMiracle XSRQMiracle released this 13 Mar 14:11
· 40 commits to main since this release
d27b791

Copilot Proxy v1.0.0

Release Date: 2026-03-13

Copilot Proxy is a self-hosted Python proxy that converts the GitHub Copilot API into an OpenAI-compatible endpoint. Use Claude, GPT, Gemini and more through your existing Copilot subscription in any OpenAI-compatible client — bypassing model restrictions on Education and Free plans.


✨ Features

Authentication

  • OAuth Device Flow — First-run guided GitHub authorization, no manual token copying required
  • Token Persistence — GitHub token saved locally in .copilot_token.json, automatically restored on next launch
  • Auto Token Refresh — Background thread refreshes the Copilot token every 25 minutes, zero intervention needed

Proxy

  • OpenAI-Compatible API — Standard OpenAI API format (/chat/completions), works with any compatible client
  • Streaming Support — Full support for streaming responses (stream: true)
  • Request Forwarding — Transparently forwards requests to api.individual.githubcopilot.com with valid credentials
  • Health Check Endpoint — GET / returns current proxy status and token readiness
  • Error Handling — Proper HTTP error codes (502, 503, 504) with descriptive messages

📦 What's Included

File Description
main.py Core proxy server
readme.md English documentation
readme_cn.md Chinese documentation
.gitignore Ignores token file, .vscode, .DS_Store
LICENSE MIT License

🚀 Quick Start

# Install dependencies
pip install flask requests

# Run
python main.py

On first run, the script will guide you through GitHub OAuth authorization. Subsequent runs will automatically use the saved token.

Configure Continue (config.yaml)

models:
  - name: Claude Sonnet 4.6 (Copilot_proxy)
    provider: openai
    model: claude-sonnet-4-20250514
    apiBase: http://localhost:15432
    apiKey: "dummy"
    roles:
      - chat
      - edit

📋 Requirements

  • Python 3.7+
  • flask, requests
  • A GitHub account with an active Copilot subscription (Free / Pro / Education)

⚠️ Notes

  • This project uses your own GitHub Copilot subscription. No third-party servers are involved.
  • Do not share your .copilot_token.json file or commit it to version control.
  • Each machine requires its own authorization.

📄 License

MIT