r/GithubCopilot • • 7d ago

Showcase ✨ I built a one-file bridge that turns my GitHub Copilot subscription into an OpenAI-compatible API (one Copilot session per chat)

Feedback welcome :)Each chat maps to one continuing Copilot session, so the provider's prompt cache survives between turns instead of being rebuilt on every request. It handles tool calls, images, reasoning output and cost reporting. Node 20.19+ and a Copilot CLI sign-in on the same machine are all it needs.Limitations: sessions live in memory, sampling params are ignored, and it is localhost-only by design.Feedback welcome :)I already pay for GitHub Copilot and wanted the same subscription to power my own agent tools, but most agent clients only speak OpenAI Chat Completions. So I wrote github-copilot-openai-bridge: one server.mjs, no build step, listens on 127.0.0.1:8787.

Each chat maps to one continuing Copilot session, so the provider's prompt cache survives between turns instead of being rebuilt on every request. It handles tool calls, images, reasoning output and cost reporting. Node 20.19+ and a Copilot CLI sign-in on the same machine are all it needs.

Limitations: sessions live in memory, sampling params are ignored, and it is localhost-only by design.

Feedback welcome :)

0 Upvotes

5 comments sorted by

5

u/kantorcodes1 7d ago

Your README says the API key can be any string unless BRIDGE_API_KEY is set. So the default setup listens on 127.0.0.1:8787 with a live Copilot sign-in behind it, and any other process on the machine can call the port and run chats against that subscription. Was making the key opt-in a deliberate trade for one-command setup, or is that a default you would tighten?

1

u/paq85 7d ago

I started with the simplest setup possible ... but yeah... probably protecting it with a key would make sense.

1

u/kantorcodes1 7d ago

That makes sense as a starting point. The Hermes side is why I asked: hermes-plugin-github-copilot downloads and runs a pinned release of this bridge, so agent clients call that port as part of normal work, not only in a local curl test. Would you want the bridge listed in the awesome-ai-plugins catalog, in Tools & Integrations, where Hermes users look for that kind of tool? If yes, I will show you the exact one-line entry format for it.

1

u/kockuma 6d ago

if i paste the same bug report into two new chats, how does the bridge tell them apart? I might ask one to write a failing test and use the other to talk through a fix befor I touch the code myself