VS Code access

VS Code’s latest official documentation has replaced the old OpenAI Compatible configuration item with Custom Endpoint (custom interface). It supports three protocols: Chat Completions, Responses and Anthropic Messages; ShangHai Do uses Chat Completions in this article.

If not yet installed, follow VS Code download page to install the client.

Applicable scope

Custom Endpoint can be connected to VS Code Chat (conversation) and Agent (an assistant that can read and write files and perform tasks). To make the model appear in the Agent's model selector, you need to set toolCalling to true. Organizational version Copilot administrators may turn off Bring Your Own Language Model Key, and personal key configuration will be unavailable after turning it off.

Add using interface

  1. Install and open VS Code and confirm that Chat / Copilot related functions are enabled.
  2. Open the model selector in the Chat view and select the gear icon Manage Language Models; you can also run Chat: Manage Language Models in the command panel.
  3. Select Add Models → Custom Endpoint.
  4. Fill in the group name, for example ShangHai Do.
  5. Fill in the site token and select Chat Completions as the API type.
  6. VS Code will open chatLanguageModels.json, add model information according to the example below and save it.

Recommended configuration

The following address is written as the complete interface path to avoid ambiguity when VS Code automatically supplements the path according to the protocol:

[
  {
    "name": "ShangHai Do",
    "vendor": "customendpoint",
    "apiKey": "${input:shanhaiApiKey}",
    "apiType": "chat-completions",
    "models": [
      {
        "id": "qwen3.8-flash",
        "name": "qwen3.8-flash",
        "url": "https://shanghaido.com/v1/chat/completions",
        "toolCalling": true,
        "vision": false,
        "streaming": true
      }
    ]
  }
]

${input:shanhaiApiKey} is the officially supported key input reference form, indicating that VS Code asks for and saves the key. **If the interface has already generated apiKey, please keep the original reference name, only merge the address and model fields, and do not directly overwrite the entire file. ** Do not write real tokens into project shared files. If you use a self-built site, replace shferry.com with the site domain name.

The model name of qwen3.8-flash must be based on the result returned by /v1/models. To configure another model, copy the objects in the models array and replace id , name , and url .

Get started

After saving the configuration, select ShangHai Do / qwen3.8-flash in Chat's model selector, send a normal question first, and then try to read or edit the file again. If the model does not appear, restart VS Code; if it does not appear in the Agent, confirm that toolCalling is not written as false.

Do not automatically turn image input on just because other models support it. This example explicitly turns it off.

Address filling rules

VS Code officially allows using the root address and automatically adding /v1/chat/completions according to apiType, and also allows writing the complete interface address. This guide uses the full address:

https://shanghaido.com/v1/chat/completions

Do not write:

https://shanghaido.com/v1/chat/completions/chat/completions

official information

encountered a problem

If you encounter problems with calling or configuration, please contact the site customer service and provide the model name, error time and error information to facilitate troubleshooting.