
GitHub Copilot
Run TokenMix models in GitHub Copilot Chat through its custom endpoint setting
What it is
GitHub Copilot is GitHub's AI coding assistant, built into editors like VS Code, Visual Studio, and the JetBrains IDEs. It offers inline code completions, a chat panel for questions and explanations, and an agent mode that can edit across multiple files. It is made by GitHub, a Microsoft subsidiary, and ships on Free, Pro, and Business or Enterprise plans.
Recent versions of Copilot in VS Code support bring-your-own-key (BYOK): you can add your own model provider, including any OpenAI-compatible endpoint. That lets you run TokenMix models inside Copilot Chat and agent mode.
Before you begin
- VS Code with the GitHub Copilot and Copilot Chat extensions installed, signed in with a GitHub account on a plan where BYOK is allowed. Individual Free and Pro plans work; on Business or Enterprise an administrator may have turned the BYOK policy off.
- A TokenMix account and an API key from the dashboard at tokenmix.ai/dashboard/keys (it starts with
sk-tm-). - The base URL
https://api.tokenmix.ai/v1.
One thing to know up front: BYOK changes the model used by Copilot Chat and agent mode. The gray inline autocomplete still runs on GitHub's own models, so it is not affected by this setting.
Connect TokenMix
- In VS Code, open the Command Palette (
Cmd/Ctrl + Shift + P) and runChat: Manage Language Models. - Choose
Add Models, then pickCustom Endpoint. On some versions this provider is namedOpenAI Compatible; if you see neither, update VS Code to the latest version. - Enter a display name such as
TokenMix, paste your TokenMix API key (sk-tm-...), and select the API typeChat Completions. - In the
chatLanguageModels.jsonfile that opens, set the endpointurltohttps://api.tokenmix.ai/v1and add the model IDs you want, such asclaude-sonnet-4.6,gpt-5.5, ordeepseek-v4-pro. Save the file. - Open the Copilot Chat panel, click the model picker at the bottom, and select your TokenMix model.
Verify it works
Open Copilot Chat, make sure your TokenMix model is selected in the picker, and ask it to explain a function or write a small snippet. A normal reply means the request went through TokenMix. You can confirm the spend in your TokenMix dashboard under usage.
FAQ
Does this replace my inline completions? No. BYOK applies to chat and agent tasks only. The inline gray-text autocomplete keeps using GitHub's models.
I do not see a Custom Endpoint option. Update VS Code and the Copilot Chat extension to the latest version. The provider that accepts a custom base URL replaced the older OpenAI Compatible entry.
It is greyed out on my work account. On Copilot Business or Enterprise, your administrator can disable the BYOK policy. Use a personal plan, or ask your admin to allow it.