r/GithubCopilot • u/paq85 • 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 :)
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
Full write-up and the code: https://www.damiansromek.pl/en/tech/blog/github-copilot-openai-bridge/ :)
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