Skip to main content
VS Code supports adding custom models to Copilot Chat through the built-in language model management. After setup, you can use HaiToken models directly in the VS Code Chat panel.

Protocol Note

VS Code’s custom model (Custom Endpoint) path is compatible with the OpenAI Chat Completions protocol. This guide uses the Custom Endpoint mode with API Type chat-completions and the full request URL https://api.haitoken.ai/v1/chat/completions.

What you need

  • VS Code with GitHub Copilot enabled
  • A HaiToken API key
  • At least one available model ID, such as gpt-5.4
  • HaiToken full request URL: https://api.haitoken.ai/v1/chat/completions

Setup Steps

Step 1: Open language model management

In the VS Code Chat panel, click the model picker next to the input box (shown as Auto by default) and select “Manage Language Models” from the dropdown. You can also open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P) and run Chat: Manage Language Models. Click the chat model picker Select Manage Language Models from the dropdown

Step 2: Add a Custom Endpoint model

On the Language Models management page, click “Add Model” and choose Custom Endpoint from the dropdown. Choose Custom Endpoint from the Add Model menu In the naming dialog, give the endpoint a name (you can keep the default Custom Endpoint) and press Enter. Name the custom endpoint

Step 3: Enter your HaiToken API key

In the API Key dialog, paste your HaiToken API key and press Enter. Enter your HaiToken API key

Step 4: Choose the API type

In the API Type dialog, select Chat Completions (the OpenAI Chat Completions protocol) and press Enter. Select Chat Completions as the API type

Step 5: Edit the config file to set the model ID and URL

After the wizard completes, VS Code automatically opens the chatLanguageModels.json config file. Find the Custom Endpoint entry you just created and fill in the following fields in the models array: Edit the chatLanguageModels.json config file Save the file, return to the Chat panel, and the newly added HaiToken model will be available in the model picker.

Verification

  1. Open the VS Code Chat panel.
  2. Select the HaiToken-backed model from the picker.
  3. Send a simple prompt such as hello.
  4. If the response returns normally, the integration works.

Notes

This BYOK path covers Copilot Chat and related agent experiences. Standard code completions (inline suggestions) are outside the documented BYOK scope and may still use Copilot-managed models.

How to switch models

Open the chat model picker in VS Code and select another HaiToken model from the list. If the model you want isn’t listed, go back to Manage Language Models and add it following Step 2–5, or append another model object to the models array of an existing Custom Endpoint in chatLanguageModels.json.

FAQ

Next