Add Feature to login to codex cli with github copilot subscription

Resolved 💬 17 comments Opened Dec 20, 2025 by styler-ai Closed Feb 28, 2026
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

What feature would you like to see?

As an enterprise I would like to use codex cli with the github copilot subscription

Additional information

_No response_

View original on GitHub ↗

17 Comments

peixotorms · 6 months ago

You can use github copilot with opencode.
I would also like to use it with codex cli, as I feel its a better client.

However note, github copilot context is limited to about 128k tokens, so even if it could be used, its not going to perform the same.
Even if models are the same, copilot has limited context, so just a heads up.
On Opencode with github, it's constantly compacting due to the small context limit, which doesn't happen if you use OpenAI API for example.

hchaudhary1 · 6 months ago

Github Copilot now has GPT-5.2-codex with full 272k context! We can use GHCP login via codex-vsc-extension, but would be nice also via CLI

Vad1mo · 5 months ago

I somehow don't see that option. (3 feb. 2026)

<img width="4212" height="3188" alt="Image" src="https://github.com/user-attachments/assets/88f20df5-b0c2-4789-8ae0-182822bb6876" />

postpersonality · 5 months ago

@hchaudhary1 thanks!

I've installed both GitHub Copilot and Codex. That works indeed.

postpersonality · 5 months ago

@Vad1mo just hit "sign in with chatgpt"

Vad1mo · 5 months ago

@postpersonality indeed this works!
Some kind of magic

styler-ai · 5 months ago

Any update?

styler-ai · 4 months ago

Hi, sry that I post again, but it would be great if I would get a response. This would be a major step to get codex cli used by more developers. Most enterprises use github copilot enterprise, so having an easy access to agentic coding is needed. In my team we have about 300 developers and in a huge enterprise we can't just switch from github copilot to openai keys for everyone. These are corporate deals. Switching this takes sometimes years. We would rather give all developers codex cli with github copilot access and then restrict it to e.g. codex models only being support as an example. This is doable. Feedback would be great @etraut-openai Thank you so much for your support

etraut-openai contributor · 4 months ago

@styler-ai, Github copilot is a different product by a different company. It leverages some of the same models used by Codex, but those models are hosted by Github (Microsoft) rather than OpenAI. I don't think the Github copilot models are hosted in a way that is compatible with the Codex harness. You'd need to contact someone on the Github copilot team to confirm. The Codex harness works with any model that is hosted using the "responses" API. Microsoft makes OpenAI models available through Azure AI Foundry, and you can use the Codex harness with those models, but I don't think those are part of a Github Copilot subscription.

If you'd like to use OpenAI-hosted Codex models, you'll need to use an OpenAI subscription account or API Keys. If you're interested in an enterprise subscription, you can contact our sales team.

I'm going to close this issue because this really isn't something that the Codex team can offer. It's a feature request for Github copilot.

styler-ai · 4 months ago
@styler-ai, Github copilot is a different product by a different company. It leverages some of the same models used by Codex, but those models are hosted by Github (Microsoft) rather than OpenAI. I don't think the Github copilot models are hosted in a way that is compatible with the Codex harness. You'd need to contact someone on the Github copilot team to confirm. The Codex harness works with any model that is hosted using the "responses" API. Microsoft makes OpenAI models available through Azure AI Foundry, and you can use the Codex harness with those models, but I don't think those are part of a Github Copilot subscription. If you'd like to use OpenAI-hosted Codex models, you'll need to use an OpenAI subscription account or API Keys. If you're interested in an enterprise subscription, you can contact our sales team. I'm going to close this issue because this really isn't something that the Codex team can offer. It's a feature request for Github copilot.

@etraut-openai the thing is that this login is possible in opencode but after we tested both clis codex is just better. You can logon in opencode with the github copilot account, so maybe you have the chance to suggest it to your team. You could restrict e.g.the model selection from github copilot only to openai models instead of all modelsx just an idea. So again: in opencode it works. Also it works with the vscode plugin, why not with codex cli?

this is what I mean:
https://github.blog/changelog/2026-01-16-github-copilot-now-supports-opencode/

imho one could add the same login method also in codex cli and then add a restriction to OpenAI Models?

So OpenAI models are supported by github copilot, so imho it doesnt make sense that you would have a collaboration with github copilot and host your models there and then we have to use another cli like opencode to use those models, it would rather be better to use those models with the cli they are ment to be used.
would be great, like I said if you could reflect on this for a bit longer. thanks

johnib · 3 months ago

For anyone still looking for this - I maintain a copilot-api fork that bridges exactly this gap. It's a proxy that exposes a full Responses API endpoint using your existing Copilot subscription, so Codex CLI works out of the box. One npx command to start.

Been maintaining it for ~9 months for several folks on my team who rely on it heavily. You're welcome to give it a try - copilot-api-node20 on npm

npx copilot-api-node20@latest start --codex

P.S. The -node20 in the package name is a relic - the original reason I forked and diverged was just to add Node 20 support. The name stuck. :)

P.S.2 With my version you also get web_search support (via Tavily, free API key with 1K searches / month)

@styler-ai

tuandinh0801 · 3 months ago
For anyone still looking for this - I maintain a copilot-api fork that bridges exactly this gap. It's a proxy that exposes a full Responses API endpoint using your existing Copilot subscription, so Codex CLI works out of the box. One npx command to start. Been maintaining it for ~9 months for several folks on my team who rely on it heavily. You're welcome to give it a try - copilot-api-node20 on npm `` npx copilot-api-node20@latest start --codex ` P.S. The -node20 in the package name is a relic - the original reason I forked and diverged was just to add Node 20 support. The name stuck. :) P.S.2 With my version you also get web_search` support (via Tavily, free API key with 1K searches / month) @styler-ai

@johnib I have tried your package, works great, any plan to opensource the code?

styler-ai · 3 months ago

I still think this should be integrated into codex ootb and the model selection be limited to openai models. Otherwise people will switch to opencode @etraut-openai

vhbui02 · 3 months ago
The Codex harness works with any model that is hosted using the "responses" API.

I can't find the link to the official GitHub Copilot documentation stated that they support the Responses API but I can confidently say that GitHub Copilot model supports it, given the logic of the following 3rd-party clients:

Microsoft makes OpenAI models available through Azure AI Foundry, and you can use the Codex harness with those models, but I don't think those are part of a Github Copilot subscription.

Is it matter if it's hosted by Microsoft or placed on Azure AI Foundary? Last time I checked harness is a client-side thing, unless OpenAI models hosted on OpenAI cloud platforms have some proprietary server-side Codex harnesses that I don't know about.

styler-ai · 3 months ago
> The Codex harness works with any model that is hosted using the "responses" API. I can't find the link to the official GitHub Copilot documentation stated that they support the Responses API but I can confidently say that GitHub Copilot model supports it, given the logic of the following 3rd-party clients: https://github.com/zed-industries/zed/blob/5a47e9825babb293a4e4aea3359fb860085ab63f/crates/copilot_chat/src/copilot_chat.rs#L112 https://github.com/anomalyco/opencode/blob/c1ddc0ea2d6733925569a6a8f937ce9aa6b04cdd/packages/opencode/src/provider/sdk/copilot/responses/openai-responses-api-types.ts > Microsoft makes OpenAI models available through Azure AI Foundry, and you can use the Codex harness with those models, but I don't think those are part of a Github Copilot subscription. Is it matter if it's hosted by Microsoft or placed on Azure AI Foundary? Last time I checked harness is a client-side thing, unless OpenAI models hosted on OpenAI cloud platforms have some proprietary server-side Codex harnesses that I don't know about.

Google opencode github copilot login. With opencode you can simply type /connect and connect via github copilot license. This should also be possible in codex imho. Most companies on enterprise level already have a github contract and you can't just change this on enterprise level if a few hundred or thousands of people are affected. The implementation for codex could simply make sure that in the model sele only openai models can be selected.

vhbui02 · 3 months ago

@styler-ai Agreed. I'm about to maintain another fork of the Rust-based Codex CLI. An early heads-up need to be made first: I don't know Rust so everything must be done via Opus 4.6 Thinking on Antigravity. I'm gathering the necessary context (linear walkthrough of Codex CLI, any known Rust-based implementation of GitHub Copilot integration like what I found in Zed, existing up-to-date "Codex-to-GitHub-Copilot" proxies, TypeScript-based rejected PRs, known issues/limitations found on GitHub Issues, ...) to make sure everything works as expected. I will inform you when it's stable enough.

trucle · 2 months ago

I agree, please support more subscriptions