Skip to main content
GitHub Copilot Chat supports custom models through Custom Endpoint. To connect BetterToken, use a GPT group API Key and select Chat Completions.
This guide configures a custom language model for GitHub Copilot Chat in VS Code. It does not replace GitHub Copilot inline code completion.

Prerequisites

  • Latest VS Code installed
  • GitHub Copilot / Copilot Chat installed and signed in
  • BetterToken API Key ready (register and get one)
  • The API Key belongs to the GPT group
  • A model ID is available, for example gpt-5.5
Do not manually write your real API Key into chatLanguageModels.json. Paste it into the VS Code API Key prompt. VS Code will generate a local secret reference such as ${input:chat.lm.secret...}.

Setup steps

1

Open model management

In the Copilot Chat input area, click the model selector, then choose Manage Models….
Open Manage Models from the Copilot Chat model selector.
2

Add Custom Endpoint

In Language Models, click Add Models, then choose Custom Endpoint.
Click Add Models in Language Models and choose Custom Endpoint.
3

Enter the group name

In Group Name, enter:
Then press Enter.
Enter BetterToken in the Group Name input.
4

Enter the API Key

VS Code will ask for the API Key. Paste your BetterToken API Key, then press Enter.This value will not be shown directly in the configuration file. VS Code stores it as a local secret and generates a reference like this:
Do not replace ${input:chat.lm.secret...} with your real API Key. Keep the secret reference generated by VS Code.
5

Select the API type

In Custom Endpoint: API Type, select Chat Completions.
Select Chat Completions in Custom Endpoint API Type.
6

Edit the JSON configuration

VS Code opens chatLanguageModels.json. Confirm or update the configuration:
Configure BetterToken model URL, toolCalling, vision, and token limits in chatLanguageModels.json.
Check these fields:
7

Save and reload VS Code

Save chatLanguageModels.json, then run:
After reload, return to the Copilot Chat model selector and choose gpt-5.5.
8

Send a test message

Send a simple message in Copilot Chat:
If Copilot Chat replies normally, the BetterToken Custom Endpoint is configured successfully.

FAQ

Why should I enter the API Key in the prompt?

VS Code stores the API Key in local secret storage and references it in JSON with ${input:chat.lm.secret...}. This is safer than writing the real API Key into the JSON file.

Why use Chat Completions?

The verified working configuration uses Chat Completions. The URL is:
Do not use /v1/responses, and do not stop at /v1.

Does this replace GitHub Copilot inline completion?

No. This Custom Endpoint is mainly used for Copilot Chat language model calls. GitHub Copilot inline completion is still provided by GitHub Copilot itself.

What should I do if I see Invalid token?

Check these items in order:
  1. The API Key was entered in the VS Code prompt
  2. JSON keeps the ${input:chat.lm.secret...} reference
  3. The API Key belongs to the GPT group
  4. url is https://www.bettertoken.ai/v1/chat/completions
  5. apiType is chat-completions
  6. The model ID is a GPT group model from the model plaza