BYOK · setup & plans

GitHub Copilot BYOK: Bring Your Own Key for Claude, GPT and Chinese Models

As of 2026-10-07, QCode's docs cover two places where GitHub Copilot can use your own API key (BYOK) for Claude: the Custom Endpoint in VS Code Chat (apiType messages) and Copilot CLI (COPILOT_PROVIDER_TYPE=anthropic). JetBrains' custom endpoint is documented as OpenAI-compatible only, so through QCode only GPT and Chinese models are confirmed to work there. VS Code's docs say BYOK models need no Copilot plan; inline suggestions do not go through BYOK.

Updated 2026-10-08

#VS Code Custom Endpoint#Copilot CLI BYOK#Anthropic Messages#OpenAI-compatible endpoint

Four values that matter

messages

VS Code apiType for Claude

VS Code's Custom Endpoint supports three APIs: Chat Completions, Responses and Anthropic Messages. QCode's docs state that Claude models only work with messages.

anthropic

Copilot CLI provider type for Claude

COPILOT_PROVIDER_TYPE officially takes only openai (the default), azure or anthropic. Use anthropic for Claude and openai for GPT and Chinese models.

Full path / root URL

The two URL forms are opposites

In VS Code the url goes all the way to the request path, e.g. https://api.qcode.cc/api/v1/messages; in the CLI, COPILOT_PROVIDER_BASE_URL is just https://api.qcode.cc/api. QCode's docs put it bluntly: the two forms are opposite, and copying one into the other will fail.

Not needed

Copilot plan for BYOK in VS Code

VS Code's docs say BYOK models work without signing into GitHub and without a Copilot plan; admins on Copilot Business and Enterprise can switch it off by policy.

What Copilot BYOK is and where it applies

As of 2026-10-07, Copilot BYOK means entering your own model provider's URL and API key in a Copilot client, so chat and agent requests go to the endpoint you configured instead of GitHub-hosted models. GitHub's docs describe two kinds. Local BYOK keeps keys client-side and stored locally, and is supported in VS Code, JetBrains, Xcode, Copilot CLI, the GitHub Copilot app and the Copilot SDK. Enterprise BYOK has enterprise or organization owners add keys centrally for Copilot Business and Enterprise users, and is in public preview. GitHub says local BYOK removes the dependency on its Copilot API, which suits air-gapped setups and users without a Copilot subscription. It only covers chat: VS Code's docs say inline suggestions (code completions) and semantic search still need a GitHub account.

Why people are looking at BYOK now

GitHub has announced three rounds of deprecations for Copilot's built-in models in just over a month. Per GitHub's changelog, Claude Opus 4.5, Opus 4.6, Sonnet 4.5 and Sonnet 4.6, among others, were deprecated across most Copilot experiences on 2026-09-01 (Sonnet 4.6 stays for individual subscribers on annual plans); Claude Opus 4.7 and three other models went from all Copilot experiences on 2026-10-02; and six more, GPT-5.5, GPT-5.4, GPT-5.4 mini, GPT-5 mini, Gemini 3.7 Flash and Grok 4.5, are due to go on 2026-10-19. With BYOK you pick the model yourself in your configuration (the models list in VS Code, COPILOT_MODEL in the CLI). The Copilot CLI release notes also say that an invalid configuration produces a clear error and the CLI never silently falls back to GitHub-hosted models.

How BYOK reached each Copilot surface

2026-04-07

Copilot CLI gains BYOK and local models: set a few environment variables before launch to use Azure OpenAI, Anthropic or any OpenAI-compatible endpoint; GitHub sign-in is not required when you use your own provider.

2026-05-28

VS Code 1.122 ships: the Custom Endpoint provider reaches Stable with Chat Completions, Responses and Messages APIs, and from this release BYOK works without signing in to GitHub.

2026-07-14

GitHub Copilot for JetBrains expands BYOK with OpenAI-compatible custom endpoints. The announcement mentions OpenAI compatibility only, so Claude through QCode cannot use this path.

Confirmed vs not verified

Confirmed (verbatim in official pages)

Each of these can be checked word for word in GitHub's docs, GitHub's changelog, VS Code's docs or QCode's docs: VS Code's Custom Endpoint supports Chat Completions, Responses and Anthropic Messages, with vendor set to customendpoint; Copilot CLI has exactly three provider types, openai, azure and anthropic, and openai means an OpenAI Chat Completions-compatible endpoint; CLI models must support tool calling and streaming, with at least a 128k context recommended; BYOK models in VS Code need no Copilot plan, while inline suggestions and semantic search still need a GitHub account; JetBrains supports OpenAI-compatible custom endpoints since 2026-07-14; BYOK in the GitHub Copilot app supports Anthropic and any OpenAI-compatible HTTP endpoint and needs a GitHub sign-in but no Copilot plan; enterprise BYOK is in public preview. On the QCode side, Claude models only work on the Anthropic-protocol endpoint.

Unverified or not published

This page draws no conclusion on three points. First, whether JetBrains can reach a custom URL over the Anthropic protocol is not stated on the official pages, and QCode's docs also mark it unconfirmed, so there is no Claude setup for JetBrains here. Second, the GitHub Copilot app and enterprise BYOK both list Anthropic and OpenAI-compatible endpoints officially, but QCode's docs give no setup for either, so this page does not spell out field values. Third, QCode's docs were verified against VS Code 1.138.0 and Copilot CLI v1.0.86; for later versions, go by the labels and field names in your own client.

VS Code or Copilot CLI?

VS Code Chat (Custom Endpoint)

Best for chat and agents inside the editor. One chatLanguageModels.json can hold a Claude group (messages) next to a GPT and Chinese-model group (chat-completions), and both show up in the model picker; for agent use, toolCalling must be true. BYOK only takes over chat, and inline suggestions still go through GitHub.

Copilot CLI (BYOK environment variables)

Best for agent workflows in the terminal. Four environment variables declare one model, and only one set is active at a time; the built-in sub-agents (explore, task, code-review) inherit the same configuration. GitHub sign-in is optional with your own provider, and a bad configuration produces an error instead of a silent switch to GitHub-hosted models.

Setup steps

Step 1, VS Code 1.122 or later: run Chat: Manage Language Models from the Command Palette, choose Add Models, then Custom Endpoint; VS Code opens chatLanguageModels.json. Step 2, a Claude group: set vendor to customendpoint, apiKey to the cr_ key created in the QCode console, apiType to messages, url to the full address https://api.qcode.cc/api/v1/messages, toolCalling to true, and add IDs such as claude-sonnet-5 under models; the name is up to you, and the docs example uses QCode Claude. Step 3, a separate group for GPT and Chinese models: apiType chat-completions with url https://api.qcode.cc/openai/v1/chat/completions; GPT can also use responses with url https://api.qcode.cc/openai/v1/responses (that endpoint serves GPT models only). Step 4, Copilot CLI with Claude: set COPILOT_PROVIDER_TYPE=anthropic, COPILOT_PROVIDER_BASE_URL=https://api.qcode.cc/api, COPILOT_PROVIDER_API_KEY to your cr_ key and COPILOT_MODEL to the model ID, then run copilot. Step 5, CLI with GPT or Chinese models: switch the type to openai and BASE_URL to https://api.qcode.cc/openai/v1 (stop at /v1, no /chat/completions); use one set or the other, as the later one overrides the earlier. Step 6, check: send a message with the custom model; a 401 means check the key, a 404 means check the URL form.

On QCode

On QCode, one cr_ key from the console works across protocols, and the request path decides the protocol: claude-sonnet-5, claude-sonnet-5-5 and claude-opus-5-5 use the Anthropic endpoint https://api.qcode.cc/api; gpt-6.1-sol, glm-5.3 and deepseek-v4.1-flash use the OpenAI-compatible endpoint https://api.qcode.cc/openai/v1. A Claude model sent to the OpenAI-compatible endpoint is rejected (model_not_available_on_endpoint), so a Copilot surface that only speaks the OpenAI-compatible protocol cannot reach Claude; use messages in VS Code, the anthropic type in the CLI, or Claude Code itself. Claude Opus 4.7, deprecated in Copilot on 2026-10-02, and GPT-5.5, due to go on 2026-10-19, are still callable on QCode as claude-opus-4-7 and gpt-5.5; check /models for the current list. Billing is per token, with each model's rate on /models, separate from any Copilot subscription; every request can be looked up by key on probe.qcode.cc.

Frequently asked questions

Can GitHub Copilot use my own Claude API key?

Yes, if you pick the right surface. As of 2026-10-07, the Custom Endpoint in VS Code Chat supports the Anthropic Messages API and Copilot CLI has an anthropic provider type, so both accept a custom URL for Claude. JetBrains' custom endpoint is documented as OpenAI-compatible only, and whether an Anthropic type works there is not confirmed on the official pages; since Claude models on QCode only work on the Anthropic-protocol endpoint, the confirmed setup there covers GPT and Chinese models only.

Do I still need a Copilot plan for BYOK?

Not always: VS Code and the GitHub Copilot app say no plan is needed, while JetBrains, Xcode and enterprise BYOK call for a Copilot license. VS Code's docs say BYOK models work without a GitHub sign-in and without a Copilot plan; in Copilot CLI, GitHub sign-in is optional when you use your own provider; the GitHub Copilot app needs a GitHub sign-in but no Copilot plan with your own provider. The 2025-09-11 announcement for JetBrains and Xcode BYOK says you need a valid Copilot license. Enterprise BYOK is for Copilot Business and Enterprise, and users need a Copilot license and internet access.

With BYOK on, do inline suggestions use my model too?

No. VS Code's docs say semantic search, inline suggestions (code completions) and embedding-based features still need a GitHub account, and BYOK applies to chat and utility tasks only; the 1.122 release notes also say inline suggestions and next edit suggestions still require a GitHub sign-in.

In VS Code, should the url be the root or the full path?

The full path. VS Code recommends the full endpoint URL including the API path; otherwise it inserts /v1 and appends the path itself. QCode's docs give https://api.qcode.cc/api/v1/messages, https://api.qcode.cc/openai/v1/chat/completions and https://api.qcode.cc/openai/v1/responses. Copilot CLI is the opposite: COPILOT_PROVIDER_BASE_URL is just https://api.qcode.cc/api or https://api.qcode.cc/openai/v1. A 404 usually means these two forms got swapped.

My work account shows no custom models. What now?

Ask your admin to check the policy first. VS Code's docs say admins of Copilot Business or Enterprise users can turn off Bring Your Own Language Model Key in VS Code in the Copilot policy settings on GitHub.com, and GitHub's docs say local BYOK in IDEs can be disabled by enterprise or organization policy. Also, a model only shows up for agents if it supports tool calling (toolCalling set to true).

Can I set this up with a QCode key?

Yes. Create a cr_ key in the console. In VS Code, use messages with url https://api.qcode.cc/api/v1/messages for claude-sonnet-5, claude-sonnet-5-5 or claude-opus-5-5, and chat-completions with url https://api.qcode.cc/openai/v1/chat/completions for gpt-6.1-sol, glm-5.3 and others. In Copilot CLI, use the anthropic type with https://api.qcode.cc/api. Billing is per token; rates and the current model list are on /models.

Sources

Copilot CLI BYOK: GitHub's doc Adding LLM models to GitHub Copilot CLI, plus GitHub changelog posts from 2026-04-07 (Copilot CLI now supports BYOK and local models) and 2026-06-17 (enterprise BYOK models in the CLI). VS Code: the VS Code doc AI language models in VS Code (BYOK and the Custom Endpoint reference) and the VS Code 1.122 release notes. The two kinds of BYOK and supported clients: GitHub's docs Bring your own key for GitHub Copilot, Enabling custom models for GitHub Copilot in your enterprise and Adding LLM models to the GitHub Copilot app, plus changelog posts from 2026-06-23 (Copilot app), 2026-07-14 and 2025-09-11 (JetBrains). Model deprecations: GitHub changelog posts from 2026-08-31, 2026-09-18 and 2026-10-02. QCode setup: QCode's GitHub Copilot doc (updated 2026-09-18) and its endpoints and API paths doc. All retrieved 2026-10-07.

Plug one key into Copilot

Both VS Code and Copilot CLI accept QCode's endpoints: Claude over the Anthropic protocol, GPT and Chinese models over the OpenAI-compatible endpoint, billed per token.

Related reading

Steps and quotes on this page were checked on 2026-10-07 against GitHub's and VS Code's official docs and QCode's docs; upstream changes may happen without notice. Client labels and field names change between versions, so go by the version you have; model availability is whatever /models shows.

Try first, then decide

Not sure which tier? Start with Starter ($8.57/mo) and upgrade when you're happy — the unused value of the old plan goes back to your balance.