CherryINCherryIN
New API Guides

VSCode Setup Guide

Use CherryIN API in VS Code Copilot Chat through Custom Endpoint (BYOK)

About VS Code BYOK

VS Code Copilot Chat supports Bring Your Own Key (BYOK) — you can plug in any OpenAI-compatible model service via Custom Endpoint.

Because CherryIN exposes an OpenAI-compatible API, you can add it through Custom Endpoint.

Prerequisites

  • A version of VS Code that supports Chat: Manage Language Models (any recent stable release; upgrade if you don't see the command)
  • GitHub Copilot Chat extension installed and enabled
  • BYOK only applies to Chat / Agent — it does not replace the model used for code completions
  • Works on Copilot Free / Pro / Pro+

Before you start

Make sure you have:

  1. Finished Quick Start and obtained your CherryIN API key
  2. Installed the latest VS Code and the GitHub Copilot Chat extension
  3. Picked a model ID such as anthropic/claude-sonnet-4.5

Setup Steps

Open the Language Models panel

Press ⌘ + Shift + P (macOS) or Ctrl + Shift + P (Windows / Linux) to open the Command Palette, type manage, and run Chat: Manage Language Models.

You can also reach the same panel from the gear icon in the Chat view.

Command Palette search for manage, select Chat: Manage Language Models

Add a Custom Endpoint

In the Language Models panel, click Add Models... in the top-right, then pick Custom Endpoint from the dropdown.

The dropdown also lists built-in providers like Anthropic / Azure / Google / Ollama / OpenAI / OpenRouter / xAIfor CherryIN, choose Custom Endpoint.

Language Models panel: click Add Models and select Custom Endpoint

Enter your API key

VS Code then shows a Custom Endpoint: API Key prompt with the placeholder Enter value for apiKey.

Paste your CherryIN API key and press Enter.

Custom Endpoint: API Key input

Choose the API Type

Next, VS Code shows a Custom Endpoint: API Type quick pick with three options:

OptionDescription
Chat CompletionsOpenAI-style Chat Completions API
ResponsesOpenAI's newer Responses API
MessagesAnthropic-style Messages API

Pick Chat Completions for CherryIN.

Why not Messages?

Even when you're using Claude models, choose Chat Completions here — CherryIN exposes the OpenAI-compatible endpoint (/v1/chat/completions), not the native Anthropic Messages protocol.

Custom Endpoint: API Type quick pick — choose Chat Completions

Fill model details in chatLanguageModels.json

After confirming the key, VS Code opens chatLanguageModels.json (in your user config directory, e.g. ~/Library/Application Support/Code/User/chatLanguageModels.json on macOS) with a skeleton entry already filled in:

chatLanguageModels.json
[
  {
    "name": "Custom Endpoint",
    "vendor": "customendpoint",
    "apiKey": "${input:chat.lm.secret.xxxxxxxx}",
    "apiType": "chat-completions",
    "models": [
      {
        "id": "",
        "name": "",
        "url": "",
        "toolCalling": true,
        "vision": true,
        "maxInputTokens": 128000,
        "maxOutputTokens": 16000
      }
    ]
  }
]

chatLanguageModels.json — the id / name / url fields you need to fill

You only need to fill three empty fields: id, name, and url (highlighted in the screenshot above). Leave the rest (vendor, apiKey, apiType, default token limits) as VS Code generated them.

Filled in for CherryIN:

chatLanguageModels.json
[
  {
    "name": "Custom Endpoint",
    "vendor": "customendpoint",
    "apiKey": "${input:chat.lm.secret.xxxxxxxx}",
    "apiType": "chat-completions",
    "models": [
      {
        "id": "anthropic/claude-sonnet-4.5",
        "name": "CherryIN · Claude Sonnet 4.5",
        "url": "https://open.cherryin.net/v1/chat/completions",
        "toolCalling": true,
        "vision": true,
        "maxInputTokens": 200000,
        "maxOutputTokens": 8192
      }
    ]
  }
]

Field guide:

FieldWhat to put
idThe exact CherryIN model ID, e.g. anthropic/claude-sonnet-4.5
nameDisplay name shown in the model picker — name it whatever you want
urlThe full endpoint path: https://open.cherryin.net/v1/chat/completions
toolCalling / visionWhether the model supports tool calls / vision — set per model
maxInputTokens / maxOutputTokensUse the model's real limits; VS Code defaults to 128000 / 16000

apiKey is a reference, not the raw key

The ${input:chat.lm.secret.xxxxxxxx} you see in the apiKey field is a reference to VS Code's Secret Storage (system keychain) — your real key has already been stored there in the previous step. Do not replace it with your raw key, or you'll leak it in plain text.

After saving the JSON, the new model appears under the Custom Endpoint group in the Language Models panel.

Switch in Chat and test

Open the Chat view, click the model picker at the bottom, switch to the CherryIN · Claude Sonnet 4.5 you just added, and send a simple message:

Read the current project structure and tell me what this repository is for.

If you get a normal response, the setup is working.


Adding multiple models

models is an array — you can register several CherryIN models in the same chatLanguageModels.json:

chatLanguageModels.json
[
  {
    "name": "Custom Endpoint",
    "vendor": "customendpoint",
    "apiKey": "${input:chat.lm.secret.xxxxxxxx}",
    "apiType": "chat-completions",
    "models": [
      {
        "id": "anthropic/claude-sonnet-4.5",
        "name": "CherryIN · Claude Sonnet 4.5",
        "url": "https://open.cherryin.net/v1/chat/completions",
        "toolCalling": true,
        "vision": true,
        "maxInputTokens": 200000,
        "maxOutputTokens": 8192
      },
      {
        "id": "anthropic/claude-opus-4",
        "name": "CherryIN · Claude Opus 4",
        "url": "https://open.cherryin.net/v1/chat/completions",
        "toolCalling": true,
        "vision": true,
        "maxInputTokens": 200000,
        "maxOutputTokens": 8192
      },
      {
        "id": "google/gemini-2.5-flash",
        "name": "CherryIN · Gemini 2.5 Flash",
        "url": "https://open.cherryin.net/v1/chat/completions",
        "toolCalling": true,
        "vision": true,
        "maxInputTokens": 1000000,
        "maxOutputTokens": 8192
      }
    ]
  }
]
Model IDBest for
anthropic/claude-sonnet-4.5Everyday coding, refactoring, code explanation
anthropic/claude-opus-4Complex analysis and long-context tasks
google/gemini-2.5-flashFaster responses and cost-sensitive usage

FAQ

I don't see Custom Endpoint in the Add Models... list

Please verify:

  1. VS Code is updated to a recent stable release (early Insiders versions used different labels)
  2. The GitHub Copilot Chat extension is installed and enabled
  3. You opened the panel via Chat: Manage Language Models from the Command Palette

I get a 404 or request failure

Custom Endpoint expects the full endpoint path, not just a base URL — make sure /chat/completions is included:

https://open.cherryin.net/v1/chat/completions

Missing /v1 or /chat/completions will return 404.

My new model doesn't appear in the model picker

  1. After saving chatLanguageModels.json, check the Language Models panel to make sure it shows up under the Custom Endpoint group
  2. In the Chat view, click the model name at the bottom and tick the new entry
  3. If it still doesn't appear, close and reopen the Chat view

Authentication still fails after I pasted the key

Check these points:

  1. The key was created in the CherryIN console
  2. There are no extra spaces around the key
  3. Your account has available balance and the key is active
  4. If the key was wrong before, run Chat: Manage Language Models again and re-enter it for Custom Endpoint

BYOK does not apply to completions

Per the official VS Code documentation, BYOK applies only to Chat / Agent. Inline code completions still use Copilot's built-in model and cannot be replaced by CherryIN.

Next steps