Skip to main content

GitHub Copilot

Add an Anyray model to VS Code Chat, route the copilot CLI, and import native usage. Native Copilot keeps working.

VS Code​

1
Allow third-party providers (Business and Enterprise)

GitHub org settings → Copilot → policies, before developers run Connect, or the models never reach the picker.

2
Use VS Code 1.121+
3
Enroll and run Connect
curl -fsSL https://app.anyray.ai/connect.sh | sh -s -- \
--enroll https://app.anyray.ai/enroll/enl_… --tools copilot

Already enrolled, or ANYRAY_CLIENT_KEY set:

npx anyray-connect@latest --gateway https://gateway.example.com --tools copilot

Add --subscription to bill your Copilot seat instead of the gateway's provider key. The ark_… key lives in VS Code SecretStorage; without a valid one, Connect changes nothing.

4
Pick an Anyray model

Select an Anyray · … model in Chat. In agent mode, enable the Anyray MCP tools under Select Tools.

5
Restart VS Code once (subscription seat)

A reload does not pick up the Agents window setting. --quit-apps restarts for you.

Subscription modeAPI-key mode
Chat optimizationYes, on Anyray modelsYes, on Anyray models
Who serves and billsGitHub, on your Copilot seatThe gateway's provider key
Gateway inference spendNone recordedRecorded and attributed
anyray_retrieve in agent modeYesNo. Text-only, so it stays out of the Agents window
Native usage visibilityThe GitHub connector, Business and Enterprise onlyNot applicable

Remote-SSH, Dev Containers, Codespaces: remote windows.

Copilot CLI​

The copilot CLI (@github/copilot) routes through GitHub's env-only BYOK.

1
Quit VS Code fully

An open editor keeps the old environment and talks straight to GitHub, with no error.

2
Run Connect
npx anyray-connect@latest --tools copilot-cli

On macOS the explicit flag lets Connect read a Keychain /login; elsewhere plain npx anyray-connect@latest covers it. It writes ~/.copilot/mcp-config.json and, on macOS and Linux, a shell-profile block reading ~/.anyray/copilot-cli.sh (0600).

3
Open a new terminal

On Windows, also restart its parent app (Windows Terminal or VS Code).

4
Verify

anyray-connect doctor --json: copilot-cli shows pointedAt: true and MCP registered.

LaneWhenBilling
Seat (default)Connect can read a Copilot sign-in (sources)Your Copilot plan. A seat with an unreadable sign-in stays on native GitHub inference, never org billing
Org (--org)You pass --org, or the machine has no Copilot seatOrg API usage, no Copilot premium requests. The machine stays on this lane
Connect reports no current models

A CLI /login token can 400 on current models. Run anyray-connect copilot-login once, then anyray-connect --tools copilot-cli. Measured numbers.

`/logout` does not stop Anyray routing

Run anyray-connect --tools copilot-cli --revert and restart the terminal. It also removes the sign-in copilot-login minted.

Models, Windows, revert: Copilot reference.

Import native Copilot usage​

Business and Enterprise: enable the GitHub connector under Settings → Providers with a read-only metrics token (which permission).

Zero-touch fleets​

With a fleet bootstrap file, the extension shows an Open sign-in notification with a code and configures itself after enrollment.

Revert​

npx anyray-connect@latest --tools copilot --revert

Then restart VS Code fully.