Set up VS Code Copilot (BYOK)

Add a Custom Endpoint to VS Code's Copilot chat and code with CherryChat models

Steps

  1. Prepare: update VS Code

    Update VS Code to the latest stable release (Custom Endpoint is recent; third-party sources say stable since 1.122). Copilot Business / Enterprise accounts need an admin to allow BYOK in the Copilot policy.

  2. Add a Custom Endpoint

    Open the Chat view, click the gear "Manage Language Models" in the model picker (or run "Chat: Manage Language Models") → "Add Models" → "Custom Endpoint". Enter the group name CherryChat, a display name, the API key (pasted into the prompt and kept in secure storage), and choose the "Chat Completions" API type.

    • API key (paste into the prompt): sk-your-key
  3. Edit chatLanguageModels.json

    VS Code opens chatLanguageModels.json. Keep the generated apiKey line as it is (never paste the plain key there), change models as below and save.

    • url (API address): https://gpt.cherrychat.org/v1 (Up to /v1; VS Code adds /chat/completions)
    • id (model name): claude-sonnet-5-5
    [
      {
        "name": "CherryChat",
        "vendor": "customendpoint",
        "apiKey": "${input:cherrychatApiKey}",
        "apiType": "chat-completions",
        "models": [
          {
            "id": "claude-sonnet-5-5",
            "name": "claude-sonnet-5-5",
            "url": "https://gpt.cherrychat.org/v1",
            "toolCalling": true,
            "vision": true,
            "maxInputTokens": 128000,
            "maxOutputTokens": 16000
          }
        ]
      }
    ]
  4. Pick it in chat

    Back in the Chat view, pick the model from the CherryChat group in the model picker and send a test message. Restart VS Code if it does not appear.

Common pitfalls

Error → cause → fix

What you seeWhyWhat to do
HTTP 401The key pasted into the prompt is wrong, has spaces, or was disabledSet the group's API key again in the Language Models editor
HTTP 404 Not FoundThe url has a wrong path, or apiType does not match it (e.g. messages with https://gpt.cherrychat.org/v1/chat/completions)Use https://gpt.cherrychat.org/v1 for chat-completions and https://gpt.cherrychat.org for messages
The CherryChat models do not show in the pickerThe JSON is invalid or VS Code has not reloadedFix the JSON (commas, brackets), save and restart VS Code
Model not foundThe id under models is misspelled (case or spaces)Copy it from the Models page, e.g. claude-sonnet-5-5
HTTP 402 or "insufficient balance" (billing_error in Claude format)Your credits cannot cover this call. API calls are paid from credits only; memberships and unlimited plans do not applyTop up any amount in the CherryChat Store, then retry after a few seconds
HTTP 429 Too Many RequestsToo many requests: by default 120 per minute per key and 8 at a time per accountLower the concurrency or requests per second in the tool and wait for the Retry-After seconds; most tools retry on their own

Guide checked 2026-11-02. The tool's screens may change; the official docs win if they differ.

API · API Pricing

Operated by UK Company CHERRYCHAT LTD · Company Number 16096119 · Support WeChat: JsnonoChat · Content is AI-generated — please verify before relying on it

CherryChat

The network is slow. Still loading…