GitHub Copilot (BYOK)
Create an API key for GitHub Copilot and add it to AnyRouter.
Use your own GitHub Copilot subscription for inference (BYOK); no AnyRouter credits are charged. Copilot does not issue a reusable inference key, so you sign in with GitHub or paste a GitHub token and AnyRouter renews the short-lived Copilot session for you.
Get your API key
- In the add-key form, choose Sign in with GitHub, enter the code at github.com/login/device, and approve with the account that has your Copilot plan. The token is filled in for you.
- Or create a fine-grained PAT with the Copilot Requests permission and paste it. GitHub's menu path is Settings > Developer settings > Fine-grained personal access tokens.
- Save the key. AnyRouter stores it encrypted and uses it only on requests you route to a Copilot model.
Gotchas
An active Copilot plan (Free, Pro, Business or Enterprise) is required. Classic ghp_ tokens are rejected by GitHub. Model availability follows your plan. Individual plans are supported today; Copilot Enterprise proxy endpoints are rejected with an actionable error. This is your own subscription injected into your own requests, never a shared or resold pool.
How the token is used
Your GitHub token never reaches the inference upstream. AnyRouter exchanges it at api.github.com/copilot_internal/v2/token for a short-lived Copilot session token, caches that session in KV, and sends the Copilot-required editor headers with each request. When the session expires it is refreshed automatically. If you paste a tid= session token directly it works until it expires, but a GitHub token is strongly preferred because it can be renewed.
Troubleshooting
| Error | Cause | Fix |
|---|---|---|
| Token exchange returned HTTP 403 | No Copilot plan, or the token lacks Copilot Requests | Check the account and token permissions |
401 unauthorized from the inference API | Session token was minted for a different integration | Re-save the key so a fresh session is minted |
| Enterprise plan error | proxy-ep points at a dedicated host | Use an individual plan for now |
Add it to AnyRouter
- Open Dashboard → BYOK, find GitHub Copilot under Available and click Add key.
- Paste the key.
- Click Save. AnyRouter validates the key against GitHub Copilot first; on failure the dialog shows the upstream error and nothing is saved.
- Create key: GitHub Copilot console
AnyRouter routes requests to third-party models. Models and outputs are provided as is, with no warranty; you use them at your own risk. Disclaimer