@@ -101,6 +101,75 @@ provider or agent runtime in three different ways.
101101 </Tab >
102102</Tabs >
103103
104+ ## GitHub Enterprise (data residency)
105+
106+ If your organization uses a data-residency GitHub Enterprise tenant (a
107+ ` *.ghe.com ` host such as ` your-org.ghe.com ` ), Copilot lives on tenant-local
108+ endpoints rather than public ` github.com ` . OpenClaw exposes this as a
109+ first-class auth choice so you do not have to hand-edit URLs.
110+
111+ <Steps >
112+ <Step title =" Pick the Enterprise auth choice " >
113+ In onboarding or `openclaw models auth`, choose
114+ **GitHub Copilot (Enterprise / data residency)**. You will be prompted for
115+ your Enterprise domain (for example `your-org.ghe.com`), then the device
116+ login runs against that tenant.
117+
118+ Enter the tenant root only (`your-org.ghe.com`). Derived service hosts such
119+ as `api.your-org.ghe.com` or `copilot-api.your-org.ghe.com` are not accepted;
120+ OpenClaw derives those endpoints from the tenant root automatically.
121+
122+ ```bash
123+ openclaw models auth login --provider github-copilot --method device-enterprise
124+ ```
125+
126+ </Step >
127+ <Step title =" Domain is persisted to config " >
128+ The chosen host is stored under the provider params so later token refreshes
129+ and completions target the tenant automatically:
130+
131+ ```json5
132+ {
133+ models: {
134+ providers: {
135+ "github-copilot": { params: { githubDomain: "your-org.ghe.com" } },
136+ },
137+ },
138+ }
139+ ```
140+
141+ </Step >
142+ </Steps >
143+
144+ The device flow, token exchange, and completions resolve to
145+ ` https://your-org.ghe.com/login/device/code ` ,
146+ ` https://api.your-org.ghe.com/copilot_internal/v2/token ` , and
147+ ` https://copilot-api.your-org.ghe.com ` respectively. Data-residency tokens carry
148+ a tenant stamp and no proxy hint, so the completions base URL falls back to the
149+ tenant Copilot host instead of the public endpoint.
150+
151+ <Note >
152+ Switching domains always re-runs the device login. If you already have a stored
153+ Copilot token and pick a different domain (public ` github.com ` ↔ a ` *.ghe.com `
154+ tenant, or one tenant to another), OpenClaw will not reuse the existing token —
155+ it forces a fresh login so the token is scoped to the domain being written to
156+ config. Re-running login for the * same* domain still offers to reuse the current
157+ token. Switching back to public ` github.com ` clears the persisted
158+ ` githubDomain ` so config returns to the default.
159+ </Note >
160+
161+ <Note >
162+ The ` COPILOT_GITHUB_DOMAIN ` environment variable overrides the resolved domain
163+ for every Copilot path that resolves it — the Enterprise device login
164+ (` --method device-enterprise ` ), the standalone
165+ ` openclaw models auth login-github-copilot ` shortcut, token refresh, embeddings,
166+ and completions. Set it to your ` *.ghe.com ` host for fully headless or CI
167+ setups. Leave it unset (and the config param absent) to use public ` github.com ` .
168+ Logins persist the domain they minted the token for (and clear it when logging
169+ in against public ` github.com ` ), so routing stays correct even after the
170+ environment variable is unset.
171+ </Note >
172+
104173## Optional flags
105174
106175| Command | Flag | Description |
0 commit comments