Docs · Provider

GitHub Copilot in Claude Code, Codex, Gemini CLI and OpenCode

A Copilot seat comes with Claude, GPT and Gemini models, among others. Sign in to Copilot once in magpie, and Claude Code, Codex, Gemini CLI, OpenCode and every other agent you connect can use the models your plan gets, through magpie’s gateway at 127.0.0.1:3425. No API key.

Sign in to Copilot

  1. Open Add providerIn magpie’s Providers tab, press + Add provider and click the Copilot tile.
  2. Enter the code on GitHubmagpie shows a code and opens GitHub’s device page, github.com/login/device. Enter the code and approve. magpie then asks GitHub whose account it is and which plan it has, and the account shows under Copilot.
  3. Pick a model for an agentIn the Agents tab, click the model on the agent’s row and choose a copilot/… model.
Terminal
magpie accounts add copilot                        # github.com
magpie accounts add copilot --host acme.ghe.com    # GitHub Enterprise on GHE.com
magpie accounts copilot                            # each account and what it has used

magpie serves a Copilot sign-in from three places:

The editors’ and the CLI’s sign-ins are only read; magpie never writes them. When both are there, the editors’ github.com sign-in comes first, then the CLI’s, then an editor’s GHE.com sign-in. If GitHub turns away the editors’ token, magpie uses the CLI’s sign-in of the same account instead, never another account’s.

GitHub Enterprise on GHE.com. An enterprise with data residency signs in at its own <name>.ghe.com, so add the account with --host (or answer the GHE.com question in the sign-in sheet). magpie accepts github.com or a <name>.ghe.com address and nothing else, so a GitHub token is never sent to a host of your choosing. The account is served at its enterprise’s copilot-api.<name>.ghe.com. One login on github.com and on GHE.com is two accounts: you and you@acme.ghe.com.

The models your seat gets

magpie asks Copilot’s /models for each account and lists what comes back, so the list follows your plan rather than a fixed table. The models are named copilot/ and Copilot’s own id: copilot/claude-opus-5.5, copilot/gpt-5.4, copilot/gpt-5.3-codex. magpie models prints them all.

Claude Code reads a Claude version written with a dot as an older model, so magpie gives it Copilot’s Claude models with dashes (claude-opus-5-5) and turns the name back before the request reaches Copilot. Other agents see Copilot’s own spelling.

In each agent

Pick the model on an agent’s row in the Agents tab, or from a terminal. Each guide says what magpie writes in that agent’s config and how to switch back.

Terminal
magpie claude copilot/claude-opus-5.5
magpie codex copilot/gpt-5.4
magpie gemini model copilot/gpt-5.4-mini
magpie opencode copilot/claude-opus-5.5

The Copilot CLI is one of the agents magpie connects, too. Its row offers auto (Copilot picks) and Copilot’s own models, plus every other model you have added to magpie, which reach it through the Copilot CLI’s providers.json.

How requests reach Copilot

Copilot doesn’t serve every model on every API. Its newest OpenAI models answer only on Responses; its Claude models on Chat Completions and Anthropic Messages; its Gemini models and the older ones on Chat Completions only. magpie sends each request on an API the model is served on, and translates between that API and the agent’s when they differ, streaming and tool calls included.

Copilot Auto

copilot/auto is the model Copilot chooses for your account. It isn’t in Copilot’s /models, so magpie always adds it. On a Student plan it is the only model you may choose.

Premium requests, usage and cost

Each Copilot account has a card with three allowances, as GitHub reports them: Premium requests, Chat requests and Completions, each as used / allowance. magpie accounts copilot prints the same.

The Usage tab counts tokens, cache hits and cost for each agent and model that went through magpie. Cost on a subscription is an estimate at the model maker’s list price, or at the price you set for the model. One difference from Anthropic’s own pricing: Copilot bills a cache write at one price however long it is kept, so magpie prices a 1-hour write at the 5-minute rate. For claude-opus-5.5 that is $5 per million tokens, where Anthropic’s 2× input would be $8.

Several accounts and failover

Troubleshooting

What you seeWhat it means
GitHub refused this Copilot sign-in; sign in againGitHub turned the account’s token away. Sign in again from its row: the account is signed in again in place, and its settings stay. A network error or a 5xx from GitHub never marks an account, and the mark goes when a request is served.
the GitHub token Copilot’s editors keep in … was refusedThe editors’ sign-in has lapsed. Sign in to Copilot again in your editor or in magpie, or move that file aside.
<login> has no Copilot subscriptionThe GitHub account you approved has no Copilot plan. Sign in with the account that has the seat.
Copilot doesn’t serve this model on Anthropic’s Messages API; it isn’t about your planCopilot serves that model on other APIs only. magpie model api copilot/<model> chat sends it on Chat Completions.
The requested model is not supported.Copilot won’t serve that model to this account now. magpie leaves it out of the account’s models and the agents’ pickers for 6 hours, then tries it again. Under Auto, another model is picked and the request is sent again.
Copilot doesn’t offer Auto to this account …Copilot made no pick and the account lists no model it may pick by hand. Check the plan at github.com/settings/copilot.
the code expired; start again · the sign-in was declined on GitHubThe device code ran out before it was entered, or the request was declined on GitHub’s page. Start the sign-in again.
Copilot signs in on github.com or an enterprise’s <name>.ghe.com, not …The --host given isn’t github.com or a GHE.com address.
subscription accounts are off in magpieSettings → Privacy → Subscription accounts is off (or magpie accounts discovery off was run), so magpie reads no sign-in and serves no subscription, Copilot included. Turn it on, or run magpie accounts discovery on.

FAQ

How do I use GitHub Copilot in Claude Code?

Sign in to Copilot in magpie (Providers, Add provider, Copilot; GitHub gives you a code to enter), then pick a copilot/… model such as copilot/claude-opus-5.5 on Claude Code’s row, or run magpie claude copilot/claude-opus-5.5. magpie writes Claude Code’s settings.json. Copilot’s Claude models get Claude Code’s Anthropic requests as they are; its GPT and Gemini models get them translated.

Can Codex use Copilot’s models?

Yes. Codex speaks OpenAI Responses, and magpie asks Copilot’s OpenAI models on Responses too, so they pass through, web search included. Copilot’s Claude and Gemini models are translated. Pick one on Codex’s row or run magpie codex copilot/gpt-5.4; it shows in Codex’s /model list.

Can I use Copilot in Gemini CLI and OpenCode?

Yes. Run magpie gemini model copilot/gpt-5.4-mini or magpie opencode copilot/claude-opus-5.5, or pick the model on the agent’s row. magpie translates Gemini CLI’s requests, and writes the model into OpenCode’s opencode.json.

Do I need VS Code or another editor signed in to Copilot?

No. magpie signs in to GitHub itself with a device code. If Copilot’s editor plugins or the Copilot CLI are already signed in on this computer, magpie reads that sign-in too, and never changes it.

Does it spend my premium requests?

Requests go to Copilot on your account, so they count against your plan as Copilot counts them. A turn you type is billed as one request; the tool replies that carry it on are not. magpie shows each account’s Premium requests, Chat requests and Completions as used out of the allowance.

Does it work with Copilot Business, Enterprise and GHE.com?

Yes. magpie reads the plan from GitHub: Free, Pro, Pro+, Max, Education, Business or Enterprise. An enterprise on GHE.com signs in with magpie accounts add copilot --host <name>.ghe.com. A Business or Enterprise seat that uses up its allowance is paused, and magpie counts the account as used up until it renews.

Why is a Copilot model missing from my list?

magpie lists what Copilot’s /models gives the account: chat models only, without the ones no model picker offers or the account can’t turn on. A model Copilot answered with “The requested model is not supported.” is left out for 6 hours, then tried again in case your plan changed.

By provider: DeepSeek · Kimi and Kimi Code · GLM Coding Plan · Qwen · MiniMax · Gemini · Grok · Mistral · OpenRouter · Ollama

Every agent: Models in Claude Code, Models in Codex, Models in Gemini CLI, Models in OpenCode. Ask on Discord if you get stuck.