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

  1. 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.
  2. 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.
  3. 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

ErrorCauseFix
Token exchange returned HTTP 403No Copilot plan, or the token lacks Copilot RequestsCheck the account and token permissions
401 unauthorized from the inference APISession token was minted for a different integrationRe-save the key so a fresh session is minted
Enterprise plan errorproxy-ep points at a dedicated hostUse an individual plan for now

Add it to AnyRouter

  1. Open Dashboard → BYOK, find GitHub Copilot under Available and click Add key.
  2. Paste the key.
  3. Click Save. AnyRouter validates the key against GitHub Copilot first; on failure the dialog shows the upstream error and nothing is saved.

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