Set up VS Code Copilot (BYOK)
Add a Custom Endpoint to VS Code's Copilot chat and code with CherryChat models
- API format: OpenAI Chat Completions
- Base URL format: Up to /v1 (https://gpt.cherrychat.org/v1)
- Recommended model: claude-sonnet-5-5, gpt-6.1-sol
- Platforms: VS Code
Steps
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.
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
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 } ] } ]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
- Choose "Custom Endpoint"; the old "OpenAI Compatible" provider and the github.copilot.chat.customOAIModels setting are deprecated.
- With url https://gpt.cherrychat.org/v1 VS Code appends /chat/completions; the full https://gpt.cherrychat.org/v1/chat/completions also works. Never put the plain key in the JSON.
- BYOK covers chat and some utility tasks only; inline completions and semantic search still use GitHub Copilot.
- Set toolCalling to true for Agent mode tools; enable vision only for vision models.
- For Claude models you can also set "apiType": "messages" with url https://gpt.cherrychat.org to use the native Claude format.
Error → cause → fix
| What you see | Why | What to do |
|---|---|---|
| HTTP 401 | The key pasted into the prompt is wrong, has spaces, or was disabled | Set the group's API key again in the Language Models editor |
| HTTP 404 Not Found | The 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 picker | The JSON is invalid or VS Code has not reloaded | Fix the JSON (commas, brackets), save and restart VS Code |
| Model not found | The 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 apply | Top up any amount in the CherryChat Store, then retry after a few seconds |
| HTTP 429 Too Many Requests | Too many requests: by default 120 per minute per key and 8 at a time per account | Lower 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.
Operated by UK Company CHERRYCHAT LTD · Company Number 16096119 · Support WeChat: JsnonoChat · Content is AI-generated — please verify before relying on it
