GitHub Copilot in Codex — Copilot Models via Codex Router
GitHub Copilot in Codex means routing the Copilot models your account can already see into the normal Codex model picker, without hard-coding a model list. The github-copilot provider is catalog-only: it ships no built-in models and instead curates whatever your plan and organization policy expose through GitHub’s own catalog.
Which Copilot models get routed
github-copilot accepts only account-visible models that advertise all three requirements:
| Requirement | Why it matters |
|---|---|
| Responses API | Codex speaks the Responses protocol; other surfaces need a different adapter |
| Streaming | Turns stream tokens as they are produced |
| Tool calls | Codex drives every turn through tool calls |
Because availability depends on your plan and organization policy, no Copilot model IDs are checked in. The catalog is whatever GitHub reports for your account at curation time.
Create a fine-grained token
Classic ghp_ tokens are not supported. Create a fine-grained GitHub PAT with the Copilot Requests permission at GitHub personal access tokens.
- Open the personal access token creation page and choose a fine-grained token.
- Grant the Copilot Requests permission.
- Copy the resulting
github_pat_value and keep it private.
Never paste the token into chat, a command argument or a tracked file. The hidden prompt stores it in protected router state.
Enable GitHub Copilot
Store the token through the hidden prompt, then curate the live catalog:
./bin/model-router codex provider-key github-copilot set
./bin/curate-models github-copilot
On Windows use ./model-router.ps1 codex with the same commands. For a foreground process, the router also falls back to environment variables in this order: COPILOT_GITHUB_TOKEN, GH_TOKEN, GITHUB_TOKEN.
Then fully quit Codex, reopen it, create a new task, and open the model picker.
How the token is validated
At request time the token is validated through GitHub’s Copilot account endpoint. That endpoint also selects your inference host, and the router accepts the host only when it is GitHub-owned. The router does not read or copy the official Copilot CLI credential store.
This integration targets GitHub.com. GitHub Enterprise Cloud data-residency hosts are not configured by the router.
Allowance and quota
Requests consume the user’s Copilot allowance. When GitHub exposes a per-user meter, the tray shows the AI-credit or legacy quota. Organization-managed plans that expose no per-seat quota fall back to router-observed traffic instead.
Verify the integration
./bin/model-router codex doctor
./bin/model-router codex providers
github-copilot must report SHOW and ready. For a live, quota-consuming check of one model:
./bin/test-model 'github-copilot/MODEL_ID' --live --yes
If nothing appears, see models missing from the picker.
Plan and policy caveats
The Copilot catalog is plan- and policy-dependent, and GitHub’s inference interface may keep evolving. Requests consume your own Copilot allowance, so use them within the GitHub Copilot terms and acceptable use policies. Routing Copilot through a third-party router is at your own risk; check GitHub’s terms before relying on it.
FAQ
Can I use GitHub Copilot models in Codex? Yes. Codex Router’s github-copilot provider routes the Copilot models your account can see into the normal Codex picker, provided those models advertise the Responses API, streaming and tool calls.
Do classic ghp_ GitHub tokens work with Codex Router? No. Copilot needs a fine-grained github_pat_ token that carries the Copilot Requests permission. Classic ghp_ tokens are not supported.
Does Codex Router read the Copilot CLI credential store? No. The router stores the PAT you enter in its own protected state and validates it at request time through GitHub’s Copilot account endpoint. It does not read or copy the official Copilot CLI credential store.
Related: models overview, custom models, installation, troubleshooting.