# Atlas GitHub Copilot error: Failed to initiate device authorization or Failed to fetch models

> Re-run `atlas auth login` and choose GitHub Copilot to restart the device flow, then confirm the GitHub account has an active Copilot subscription.

Atlas fails GitHub Copilot setup with Failed to initiate device authorization when the device-authorization request is not ok, and with Failed to fetch models: <status> when the Copilot model catalog throws the HTTP status returned by the models endpoint. The fix is to re-run `atlas auth login`, choose GitHub Copilot to restart the device flow, and confirm the GitHub account has an active Copilot subscription. A models fetch returning 401 or 403 means the Copilot token expired and you need to re-authenticate.

## Symptom

Copilot setup in Atlas fails with: Failed to initiate device authorization. Or, after the device flow appears to complete, a later step fails with: Failed to fetch models: <status>, where <status> is the HTTP status returned by the Copilot models endpoint.

## Cause

The github-copilot plugin in Atlas throws when the device-authorization request is not ok, so the GitHub device flow never produces a user code. Separately, the plugin's model catalog throws with the HTTP status when the models endpoint fails, which is what surfaces as Failed to fetch models: <status>.

## Fix

1. Re-run `atlas auth login` and choose GitHub Copilot to restart the device flow.
2. Complete the GitHub device authorization in the browser without closing the Atlas prompt.
3. Confirm the GitHub account has an active Copilot subscription.
4. If the models fetch returns 401 or 403, treat the Copilot token as expired and re-authenticate with `atlas auth login`.
5. Check network egress to the GitHub API host if the device request never starts.
6. Re-run the original Atlas command once the Copilot model list loads.

## Why does Atlas fail with Failed to initiate device authorization?

Atlas prints Failed to initiate device authorization because the github-copilot plugin throws when the device-authorization request is not ok. The GitHub device flow never starts, so 0 user codes are ever issued. Re-run `atlas auth login` and choose GitHub Copilot to restart the flow.

The GitHub Copilot integration in Atlas begins by asking GitHub to start a device authorization. When that first request comes back not ok, the github-copilot plugin throws immediately rather than waiting on a code that will never arrive. That is why the failure appears at the very beginning of Copilot setup, before any browser window is useful. The two things worth checking are whether the GitHub account has an active Copilot subscription and whether network egress to the GitHub API host is permitted from the machine running Atlas. Both are documented causes. Nothing about your Atlas config needs to change to recover from this.

## Why does Atlas say Failed to fetch models after Copilot login?

Atlas reports Failed to fetch models: <status> when the GitHub Copilot model catalog throws with the HTTP status returned by the models endpoint. A status of 401 or 403 means the Copilot token expired, so re-run `atlas auth login`, choose GitHub Copilot, and re-authenticate.

Failed to fetch models is a distinct failure from the device authorization failure, and the distinction matters. The device flow can complete successfully and store a token, and the model catalog request can still be rejected later. Atlas surfaces the raw HTTP status in the message precisely so you can tell those apart. A 401 or 403 in that message is an authentication problem, not a network problem, and the documented remedy is re-authentication. If the status is something else, the token is not necessarily stale, and network egress to the GitHub API host is the next thing to check.

## How to fix the GitHub Copilot device authorization failure in Atlas

Fix the Atlas GitHub Copilot failure in four documented steps: re-run `atlas auth login` and choose GitHub Copilot, confirm the GitHub account has an active Copilot subscription, re-authenticate when the models fetch returns 401 or 403, and check network egress to the GitHub API host.

Work the steps in that order, because each one rules out the next. Restarting the device flow with `atlas auth login` is cheap and resolves the common case of a token that has gone stale. Subscription state is the next most common cause: the GitHub account must have an active Copilot subscription, and a lapsed one produces an authorization failure that no amount of retrying will clear. Only after those two should you look at the network. Atlas does not need a config edit for any of this, since Copilot credentials are managed by the auth flow rather than by a config key.

## Does an inactive Copilot subscription cause this Atlas error?

An inactive GitHub Copilot subscription is one of the four documented causes of Copilot setup failure in Atlas. Confirming the GitHub account has an active Copilot subscription is a required step, because the device flow can finish while the models endpoint still rejects the token with a 401 or 403.

Subscription state is easy to overlook because the Atlas error text names the technical failure, not the billing one. Failed to fetch models: 403 is what an unauthorized Copilot account looks like from inside Atlas. Check the subscription on the GitHub account you actually authorized, not the one you assume you used, since the device flow authorizes whichever account is signed in to the browser. Once the subscription is confirmed active, re-run `atlas auth login`, choose GitHub Copilot, and let the device flow issue a fresh token. Be honest with yourself here: Atlas cannot work around a lapsed subscription.

## What if the Atlas Copilot device request never starts at all?

When the Atlas Copilot device request never starts, check network egress to the GitHub API host. The github-copilot plugin throws Failed to initiate device authorization the moment the device-authorization request is not ok, so a blocked outbound path in 2026 produces that error before any user code is ever displayed.

A blocked or proxied network path is the failure mode where retrying is pointless. If the Atlas process cannot reach the GitHub API host, the device-authorization request will keep coming back not ok, and the github-copilot plugin will keep throwing at the same point. Confirm outbound access from the exact machine running Atlas, not from a workstation on a different network segment. Corporate proxies and egress allowlists are the usual culprits. Once egress to the GitHub API host is confirmed, re-run `atlas auth login` and choose GitHub Copilot, and the device flow should issue a code normally.

## How to verify the Copilot fix worked in Atlas

Verify the Atlas GitHub Copilot fix by running `atlas auth login` again, choosing GitHub Copilot, and completing the device flow with no Failed to initiate device authorization message. Then confirm the model catalog loads with no Failed to fetch models: 401 or 403, because both halves must be clean.

A successful verification has two halves, matching the two failures. First, the device flow completes and Atlas does not throw Failed to initiate device authorization. Second, the model catalog loads and Atlas does not throw Failed to fetch models: <status>. Only when both are clean is Copilot actually usable. Open the model switcher and confirm the Copilot models appear in the list. If the device flow succeeds but the catalog still fails with 401 or 403, the token is expired again or the GitHub account still lacks an active Copilot subscription, and the subscription is the thing to fix.

## FAQ

### How do I fix Failed to initiate device authorization in Atlas?

Re-run `atlas auth login` and choose GitHub Copilot to restart the device flow. The github-copilot plugin throws that error when the device-authorization request is not ok, so a fresh flow usually clears it. If the request never starts, check network egress to the GitHub API host.

### What does Failed to fetch models: 401 mean in Atlas Copilot?

A models fetch returning 401 or 403 means the Copilot token expired. Re-authenticate by running `atlas auth login` and choosing GitHub Copilot. The Copilot model catalog in Atlas throws with the HTTP status when the models endpoint fails, which is why the status is printed in the message.

### Does Atlas Copilot require an active Copilot subscription?

Yes. Confirming the GitHub account has an active Copilot subscription is a documented fix step for Atlas Copilot setup failures. The device flow can complete while the models endpoint still rejects the token, so a lapsed subscription surfaces as Failed to fetch models rather than as a login error.

### Why does Atlas Copilot auth fail behind a corporate proxy?

If Atlas cannot reach the GitHub API host, the device-authorization request comes back not ok and the github-copilot plugin throws Failed to initiate device authorization. Check network egress to the GitHub API host from the machine running Atlas, then re-run `atlas auth login`.

### How do I re-authenticate GitHub Copilot in Atlas?

Run `atlas auth login` and choose GitHub Copilot. That restarts the device flow and issues a fresh token, which is the documented remedy when the models fetch returns 401 or 403 and the Copilot token has expired.

### Is the Atlas Copilot device authorization error a config problem?

No. The failure comes from the github-copilot plugin throwing when the device-authorization request is not ok, or from the model catalog throwing with the HTTP status when the models endpoint fails. Both are auth and network conditions, not Atlas config keys, so the fix is `atlas auth login`, not a config edit.

### How do I confirm Copilot is working again in Atlas?

Complete `atlas auth login` with GitHub Copilot selected, then confirm the Copilot models load with no Failed to fetch models error. Atlas lets you switch the active model and provider on the fly with favorites and recents, so the Copilot models should appear in the switcher.

---

Canonical HTML: https://runatlas.sh/resources/troubleshooting/github-copilot-auth-failed
Source of truth: aeo_pages row `/resources/troubleshooting/github-copilot-auth-failed` (segment: Troubleshooting) (this file is generated from it, never hand-edited).
Licence: Atlas is proprietary with a free core. It is not open source and there is no public source repository.
