GitHub Copilot

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

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

  1. In VS Code, open the Command Palette (Cmd/Ctrl + Shift + P) and run Chat: Manage Language Models.
  2. Choose Add Models, then pick Custom Endpoint. On some versions this provider is named OpenAI Compatible; if you see neither, update VS Code to the latest version.
  3. Enter a display name such as TokenMix, paste your TokenMix API key (sk-tm-...), and select the API type Chat Completions.
  4. In the chatLanguageModels.json file that opens, set the endpoint url to https://api.tokenmix.ai/v1 and add the model IDs you want, such as claude-sonnet-4.6, gpt-5.5, or deepseek-v4-pro. Save the file.
  5. 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.