{"id":35117008,"url":"https://github.com/suhaibbinyounis/github-copilot-api-vscode","last_synced_at":"2026-04-03T12:03:34.178Z","repository":{"id":329489953,"uuid":"1114656121","full_name":"suhaibbinyounis/github-copilot-api-vscode","owner":"suhaibbinyounis","description":"Unlock GitHub Copilot as a local API Gateway. Use Copilot with Cursor, LangChain, and any OpenAI-compatible tool.","archived":false,"fork":false,"pushed_at":"2026-03-09T09:25:29.000Z","size":21795,"stargazers_count":50,"open_issues_count":7,"forks_count":10,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-09T13:43:52.393Z","etag":null,"topics":["anthropic","api","api-gateway","claude","collaborate","copilot","gemini","github-copilot","github-education-pack","llama","local-llm","openai","proxy","student-vscode","vscode"],"latest_commit_sha":null,"homepage":"https://copilot-api.suhaib.in","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/suhaibbinyounis.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"suhaibbinyounis"}},"created_at":"2025-12-11T17:30:02.000Z","updated_at":"2026-03-09T09:59:38.000Z","dependencies_parsed_at":"2025-12-22T10:02:34.482Z","dependency_job_id":null,"html_url":"https://github.com/suhaibbinyounis/github-copilot-api-vscode","commit_stats":null,"previous_names":["suhaibbinyounis/github-copilot-api-vscode"],"tags_count":41,"template":false,"template_full_name":null,"purl":"pkg:github/suhaibbinyounis/github-copilot-api-vscode","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suhaibbinyounis%2Fgithub-copilot-api-vscode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suhaibbinyounis%2Fgithub-copilot-api-vscode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suhaibbinyounis%2Fgithub-copilot-api-vscode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suhaibbinyounis%2Fgithub-copilot-api-vscode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/suhaibbinyounis","download_url":"https://codeload.github.com/suhaibbinyounis/github-copilot-api-vscode/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suhaibbinyounis%2Fgithub-copilot-api-vscode/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31349561,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-03T08:03:20.796Z","status":"ssl_error","status_checked_at":"2026-04-03T08:00:37.834Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["anthropic","api","api-gateway","claude","collaborate","copilot","gemini","github-copilot","github-education-pack","llama","local-llm","openai","proxy","student-vscode","vscode"],"created_at":"2025-12-27T21:07:27.963Z","updated_at":"2026-04-03T12:03:34.172Z","avatar_url":"https://github.com/suhaibbinyounis.png","language":"TypeScript","readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"media/icon.png\" alt=\"GitHub Copilot API Gateway\" width=\"128\" height=\"128\"\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eGitHub Copilot API Gateway\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eUse GitHub Copilot, Gemini, Ollama \u0026 any VS Code AI — like any other API.\u003c/strong\u003e\u003cbr\u003e\n  One extension. Zero API keys. Auto-discovers every model. Works with LangChain, Cursor, Aider, and 50+ tools.\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://marketplace.visualstudio.com/items?itemName=suhaibbinyounis.github-copilot-api-vscode\"\u003e\n    \u003cimg src=\"https://img.shields.io/visual-studio-marketplace/v/suhaibbinyounis.github-copilot-api-vscode?style=for-the-badge\u0026logo=visual-studio-code\u0026logoColor=white\u0026label=VS%20Code\" alt=\"VS Code Marketplace\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://marketplace.visualstudio.com/items?itemName=suhaibbinyounis.github-copilot-api-vscode\"\u003e\n    \u003cimg src=\"https://img.shields.io/visual-studio-marketplace/i/suhaibbinyounis.github-copilot-api-vscode?style=for-the-badge\u0026logo=visual-studio-code\u0026logoColor=white\u0026label=Installs\" alt=\"VS Code Installs\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://open-vsx.org/extension/suhaibbinyounis/github-copilot-api-vscode\"\u003e\n    \u003cimg src=\"https://img.shields.io/open-vsx/v/suhaibbinyounis/github-copilot-api-vscode?style=for-the-badge\u0026logo=eclipse-ide\u0026logoColor=white\u0026label=Open%20VSX\" alt=\"Open VSX\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://open-vsx.org/extension/suhaibbinyounis/github-copilot-api-vscode\"\u003e\n    \u003cimg src=\"https://img.shields.io/open-vsx/dt/suhaibbinyounis/github-copilot-api-vscode?style=for-the-badge\u0026logo=eclipse-ide\u0026logoColor=white\u0026label=Downloads\" alt=\"Open VSX Downloads\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/suhaibbinyounis/github-copilot-api-vscode/stargazers\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/stars/suhaibbinyounis/github-copilot-api-vscode?style=for-the-badge\u0026logo=github\u0026color=yellow\" alt=\"GitHub Stars\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://opensource.org/licenses/MIT\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/License-MIT-blue.svg?style=for-the-badge\" alt=\"License: MIT\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/OpenAI-412991?style=flat-square\u0026logo=openai\u0026logoColor=white\" alt=\"OpenAI\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Anthropic-191919?style=flat-square\u0026logo=anthropic\u0026logoColor=white\" alt=\"Anthropic\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Google-4285F4?style=flat-square\u0026logo=google\u0026logoColor=white\" alt=\"Google\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Meta-0467DF?style=flat-square\u0026logo=meta\u0026logoColor=white\" alt=\"Meta\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Ollama-000000?style=flat-square\u0026logo=ollama\u0026logoColor=white\" alt=\"Ollama\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"demo.gif\" alt=\"GitHub Copilot API Gateway Demo\" width=\"800\"\u003e\n\u003c/p\u003e\n\n---\n\n## ⚡ Quick Start\n\n```bash\n# 1. Install from VS Code Marketplace (search \"GitHub Copilot API Gateway\")\n# 2. Click \"Start Server\" in the sidebar\n# 3. Done. Your local API is ready.\n```\n\n**Use it like OpenAI:**\n\n```python\nfrom openai import OpenAI\n\nclient = OpenAI(\n    base_url=\"http://127.0.0.1:3030/v1\",\n    api_key=\"anything\"  # No real API key needed\n)\n\nresponse = client.chat.completions.create(\n    model=\"gpt-4o\",\n    messages=[{\"role\": \"user\", \"content\": \"Hello!\"}]\n)\n```\n\n\u003e 🔒 **Your data stays local.** This extension runs entirely on your machine — no third-party servers, no telemetry, no data collection. The full source code is available on [GitHub](https://github.com/suhaibbinyounis/github-copilot-api-vscode) for you to audit.\n\n---\n\n## ✅ What You Can Do\n\n- **Use [Cursor](https://cursor.sh)** with Copilot, Gemini, or Ollama as the backend\n- **Run [LangChain](https://langchain.com) agents** without paying for OpenAI\n- **Power [AutoGPT](https://github.com/Significant-Gravitas/AutoGPT)** and [CrewAI](https://crewai.com) agents locally\n- **Query data** with [PandasAI](https://pandas-ai.com) and [LlamaIndex](https://llamaindex.ai)\n- **Build chatbots** with Botpress, Chainlit, or Rasa\n- **Pair program** with [Aider](https://aider.chat) or [Open Interpreter](https://openinterpreter.com)\n- **Generate code** with GPT Engineer or Sweep\n- **Connect [Clawdbot](https://github.com/clawdbot/clawdbot)** to power AI on WhatsApp, Telegram, Discord \u0026 Slack\n- **Mix and match models** — route one request to GPT-4o, the next to Gemini, all on `localhost:3030`\n\nIf it speaks OpenAI, it works with this gateway.\n\n### 🔀 Multi-Provider: One Endpoint, Every Model\n\nThis gateway **auto-discovers all AI models** registered in VS Code — not just Copilot.\n\n| Provider | How to enable | Example models |\n|----------|---------------|----------------|\n| **GitHub Copilot** | Install [GitHub Copilot](https://marketplace.visualstudio.com/items?itemName=GitHub.copilot) extension | `gpt-4o`, `claude-3.5-sonnet`, `o3-mini` |\n| **Google Gemini** | Install [Gemini Code Assist](https://marketplace.visualstudio.com/items?itemName=Google.geminicodeassist) extension | `gemini-2.0-flash` |\n| **Ollama** | Install an Ollama VS Code extension | Local models (llama3, mistral, etc.) |\n| **Any other** | Any extension using `vscode.lm` API | Automatically discovered |\n\nAll models are exposed at `GET /v1/models` and routable via the `model` field in any request. No config changes needed — just install the VS Code extension and the models appear.\n\n### 🤖 Using with Clawdbot (Moltbot)\n\n[Clawdbot](https://github.com/clawdbot/clawdbot) is an open-source AI assistant that brings LLMs to messaging platforms like **WhatsApp**, **Telegram**, **Discord**, and **Slack**. Since it supports any OpenAI-compatible API endpoint, you can use this gateway to power Clawdbot with GitHub Copilot:\n\n1. Start the Copilot API Gateway in VS Code\n2. Expose the API (set host to `0.0.0.0` if Clawdbot runs on another machine)\n3. Configure Clawdbot to use your gateway:\n\n```yaml\n# In your Clawdbot config\nllm:\n  provider: openai\n  base_url: http://YOUR-IP:3030/v1\n  api_key: your-optional-api-key  # or \"anything\" if auth is disabled\n  model: gpt-4o\n```\n\nNow your WhatsApp/Telegram/Discord/Slack bots are powered by Copilot! 🚀\n\n### 🌐 Internet Access via Cloudflare Tunnels\n\nAccess your Copilot API from anywhere — your phone, tablet, or share with friends:\n\n1. Enable authentication (set an API key in Security settings)\n2. Start the server\n3. Click **\"Go Live\"** in the Internet Access section\n4. Get a public `*.trycloudflare.com` URL instantly\n\n**Free, no Cloudflare account needed!** Perfect for:\n- Accessing from your phone outside your home network\n- Sharing with friends or teammates temporarily\n- Remote development without VPN setup\n\n---\n\n### 🖥️ Run as a Background Service\n\nThe gateway runs inside VS Code's extension host, so VS Code must be running — but it **doesn't need to be visible**. Here's how to run it like a background service:\n\n**Prerequisites:** Enable `autoStart` so the server launches automatically:\n```json\n{ \"githubCopilotApi.server.autoStart\": true }\n```\n\n**macOS:**\n```bash\n# Launch VS Code minimized (gateway starts automatically)\nopen -a \"Visual Studio Code\" --args --disable-workspace-trust\n\n# Or run completely headless via CLI\nnohup code --disable-workspace-trust \u0026\u003e/dev/null \u0026\n```\n\n**Windows (PowerShell):**\n```powershell\n# Launch minimized\nStart-Process code -ArgumentList \"--disable-workspace-trust\" -WindowStyle Minimized\n\n# Or add to Task Scheduler for start-on-boot:\n# Program: code\n# Arguments: --disable-workspace-trust\n```\n\n**Linux:**\n```bash\n# Run in background\nnohup code --disable-workspace-trust \u0026\u003e/dev/null \u0026\n\n# Or create a systemd user service (~/.config/systemd/user/copilot-api.service):\n# [Service]\n# ExecStart=/usr/bin/code --disable-workspace-trust\n# Restart=on-failure\n# Then: systemctl --user enable --now copilot-api\n```\n\n\u003e **Note:** VS Code must remain running in the background. If you close VS Code, the gateway stops. The `autoStart` setting ensures the API server starts the moment VS Code opens — no manual clicks needed.\n\n## 🔌 API Endpoints\n\n| Endpoint | Method | Description |\n|----------|--------|-------------|\n| `/v1/chat/completions` | POST | Chat completions (streaming supported) |\n| `/v1/completions` | POST | Legacy completions API (streaming supported) |\n| `/v1/responses` | POST | OpenAI Responses API (2026 spec, streaming supported) |\n| `/v1/models` | GET | List all available models |\n| `/v1/tools` | GET | List available tools (VS Code + MCP) |\n| `/v1/tools/call` | POST | Execute a tool directly |\n| `/v1/mcp/servers` | GET | List connected MCP servers |\n| `/v1/messages` | POST | Anthropic Claude-compatible endpoint |\n| `/v1beta/models/:model:generateContent` | POST | Google Gemini-compatible endpoint |\n| `/health` | GET | Server health check |\n| `/docs` | GET | Interactive Swagger UI |\n\n---\n\n## ⚙️ Configuration\n\nCustomize in VS Code Settings (`githubCopilotApi.*`):\n\n```json\n{\n  \"githubCopilotApi.server.port\": 3030,\n  \"githubCopilotApi.server.host\": \"127.0.0.1\",\n  \"githubCopilotApi.server.apiKey\": \"\",\n  \"githubCopilotApi.server.autoStart\": false\n}\n```\n\n| Setting | Default | Description |\n|---------|---------|-------------|\n| `server.port` | 3030 | Local server port |\n| `server.host` | 127.0.0.1 | Bind address (use `0.0.0.0` for LAN access) |\n| `server.apiKey` | *(empty)* | Optional Bearer token for authentication |\n| `server.autoStart` | false | Start server when VS Code opens |\n\nFor advanced options (TLS, IP allowlisting, audit logging), see [CONTRIBUTING.md](CONTRIBUTING.md).\n\n---\n\n## 📦 Requirements\n\n- **VS Code 1.95+**\n- **GitHub Copilot Chat extension** (must be signed in)\n\n---\n\n## 📖 Documentation\n\n- [Official Docs](https://notes.suhaib.in/docs/vscode/extensions/github-copilot-api-gateway/)\n- [Contributing Guide](CONTRIBUTING.md)\n- [Changelog](CHANGELOG.md)\n\n---\n\n## 🛡️ Trust \u0026 Transparency\n\nThis project is **100% free and open-source** under the [MIT License](LICENSE).\n\n- 🔍 **Full source code** available on [GitHub](https://github.com/suhaibbinyounis/github-copilot-api-vscode)\n- 🚫 **No telemetry** — zero data collection, no analytics, no tracking\n- 🔒 **Runs locally** — your prompts and API keys never leave your machine\n- ✅ **Community-driven** — contributions welcome via [CONTRIBUTING.md](CONTRIBUTING.md)\n- 🛡️ **Security** — report vulnerabilities via [SECURITY.md](SECURITY.md)\n\n\u003e **Disclaimer:** This extension is an independent, community-built project and is not affiliated with GitHub, Microsoft, or OpenAI. It leverages your existing GitHub Copilot subscription. Use responsibly.\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eBuilt with ❤️ by \u003ca href=\"https://suhaibbinyounis.com\"\u003eSuhaib Bin Younis\u003c/a\u003e\u003c/strong\u003e\n\u003c/p\u003e","funding_links":["https://github.com/sponsors/suhaibbinyounis"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuhaibbinyounis%2Fgithub-copilot-api-vscode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuhaibbinyounis%2Fgithub-copilot-api-vscode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuhaibbinyounis%2Fgithub-copilot-api-vscode/lists"}