You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e24ee5f
Browse filesBrowse the repository at this point in the historyBrowse files
The GitHub Copilot provider lets you use models served by `api.githubcopilot.com` — Claude, GPT, Gemini, Grok, Kimi, and others — with a Copilot subscription.
4
+
5
+
## Setup
6
+
7
+
Copilot authenticates with GitHub OAuth. Sign in through the bundled CLI device flow:
Credentials are stored in `~/.codework/aikit/auth.json` under the `github-copilot` key. Login records the plan-specific API endpoint (individual vs. business) and the account's available model ids.
17
+
18
+
The provider also picks up existing credentials without a separate login:
19
+
20
+
```bash
21
+
export COPILOT_GITHUB_TOKEN="ghu_..."# or GITHUB_TOKEN / GH_TOKEN
22
+
```
23
+
24
+
It reads `~/.config/github-copilot/hosts.json` (fallback `apps.json`) — the file VS Code, JetBrains, and Neovim Copilot clients already persist — so an editor sign-in is enough.
25
+
26
+
GitHub OAuth tokens are used directly as the `Authorization: Bearer` credential. They do not expire; re-run `auth --github-copilot` if calls start returning persistent `401`s.
The authenticated `/models` catalog's `supported_endpoints` is authoritative; the static routing above is the offline approximation.
58
+
59
+
Every request sends the Copilot identity headers (`User-Agent: GitHubCopilotChat/…`, `Editor-Version`, `Editor-Plugin-Version`, `Copilot-Integration-Id`, `X-GitHub-Api-Version`) plus `x-initiator` (`user` vs `agent`, inferred from the last message role) and `Copilot-Vision-Request` when the payload contains images. `options.sessionId` maps to `X-Interaction-Id` for session grouping.
60
+
61
+
## Thinking / reasoning
62
+
63
+
Copilot models carry `thinkingLevelMap` derived from the live catalog's `reasoning_options`, with manual overrides for verified behavior (e.g. Opus 4.7/4.8/5 clamp `minimal` to `low`). Adaptive Claude models send `effort` instead of a token budget; Responses models send `reasoningEffort` with `store: false` + encrypted reasoning content; the chat route has no reasoning control.
Note: Copilot Free accounts (`free_limited_copilot` SKU) can only reach a small subset of models — typically just `gpt-4.1` — regardless of what the catalog lists. Plan-restricted models fail with `model_not_supported`.
0 commit comments