GitHub Copilot
Add an Anyray model to VS Code Chat, route the copilot CLI, and import native usage. Native
Copilot keeps working.
VS Code
GitHub org settings → Copilot → policies, before developers run Connect, or the models never reach the picker.
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.
Select an Anyray · … model in Chat. In agent mode, enable the Anyray MCP tools under Select Tools.
A reload does not pick up the Agents window setting. --quit-apps restarts for you.
| Subscription mode | API-key mode | |
|---|---|---|
| Chat optimization | Yes, on Anyray models | Yes, on Anyray models |
| Who serves and bills | GitHub, on your Copilot seat | The gateway's provider key |
| Gateway inference spend | None recorded | Recorded and attributed |
anyray_retrieve in agent mode | Yes | No. Text-only, so it stays out of the Agents window |
| Native usage visibility | The GitHub connector, Business and Enterprise only | Not applicable |
Remote-SSH, Dev Containers, Codespaces: remote windows.
Copilot CLI
The copilot CLI (@github/copilot) routes through GitHub's env-only BYOK.
An open editor keeps the old environment and talks straight to GitHub, with no error.
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).
On Windows, also restart its parent app (Windows Terminal or VS Code).
anyray-connect doctor --json: copilot-cli shows pointedAt: true and MCP registered.
| Lane | When | Billing |
|---|---|---|
| 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 seat | Org 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.