# Bring Router One models into GitHub Copilot Chat in VS Code

> Markdown mirror of https://router.one/integrations/github-copilot for AI assistants and crawlers. Router One is an OpenAI-compatible LLM API gateway.
> Last updated: 2026-09-07

GitHub Copilot in VS Code can run chat and agent sessions on a language model you supply — Bring Your Own Key (BYOK) — through its Custom Endpoint provider, which reached VS Code Stable in 1.122 (May 2026). Pointing that provider at Router One puts GPT, Claude, Gemini, and Grok family models in the Copilot model picker behind one key, billed to your Router One wallet instead of Copilot's request quota, with a per-request trace of tokens, cost, and latency. Inline suggestions, semantic search, and embeddings stay on GitHub's own service; only chat and agent workflows and, if you opt in, background utility tasks move to your key.

## Check the VS Code version and your Copilot plan

The Custom Endpoint provider replaced the older OpenAI Compatible provider and its github.copilot.chat.customOAIModels setting: it previewed in VS Code Insiders 1.121 and shipped in Stable 1.122 (release notes dated May 28, 2026), so update VS Code first if Add Models still lists only the old provider. BYOK needs no Copilot plan and no GitHub sign-in for chat; a Router One key is enough. On Copilot Business or Enterprise, the organization policy Bring Your Own Language Model Key in VS Code applies — GitHub's April 2026 changelog says it is enabled by default and that an administrator can turn it off — if Custom Endpoint is missing from Add Models, ask your admin before debugging the configuration. Usage on a BYOK model is billed by the provider you configured, here your Router One wallet, and does not count against Copilot's request quota.

## Configure GitHub Copilot to use the Router One base URL

Run Chat: Manage Language Models from the Command Palette (or select the gear icon in the chat model picker), choose Add Models → Custom Endpoint, enter a group name such as Router One, then a display name and your Router One key, and pick Chat Completions as the API type. VS Code opens chatLanguageModels.json; make its models array match the entry below. The url is the full /v1/chat/completions endpoint: the official docs recommend the full path to avoid ambiguity, and VS Code uses it as-is. Keep apiKey as an input variable instead of pasting the raw key into the file; rotate it later with Update API Key in the Language Models editor. toolCalling must be true for the model to be listed when you use agents in chat, so choose a model whose detail page lists tool calling; set vision from the model's input modalities; and keep maxInputTokens plus maxOutputTokens within the context window shown on the model page, because VS Code treats their sum as the total context window:

`chatLanguageModels.json`

```json
[
  {
    "name": "Router One",
    "vendor": "customendpoint",
    "apiKey": "${input:routerOneApiKey}",
    "apiType": "chat-completions",
    "models": [
      {
        "id": "<model-id-from-/models>",
        "name": "<label shown in the model picker>",
        "url": "https://api.router.one/v1/chat/completions",
        "toolCalling": true,
        "vision": <true if the model page lists image input>,
        "maxInputTokens": <context window minus maxOutputTokens>,
        "maxOutputTokens": <output tokens you allow per reply>
      }
    ]
  }
]
```

## What runs on your Router One key, and what stays on Copilot

BYOK covers the chat experience in the Chat view — chat and agent workflows — plus background utility tasks if you opt in. Everything else keeps using GitHub's service and needs a signed-in account with a Copilot plan. Once both utility settings point at Router One, every background call also lands in Dashboard → Logs under the same key, so give VS Code a dedicated key with a maxSpend cap: a long agent session or a chatty utility model then stops at the limit you set.

| Feature | Model used | What to configure |
| --- | --- | --- |
| Chat view: chat and agent workflows | The Router One model selected in the picker | Pick the group you named; with agents, only models with toolCalling: true are listed |
| Utility tasks: titles, commit messages, PR descriptions, intent detection | Copilot's built-in utility models by default | Set chat.utilityModel and chat.utilitySmallModel to a Router One model, or set chat.byokUtilityModelDefault to Main Agent Model |
| Inline suggestions (code completions), semantic search, embeddings | GitHub Copilot service only | Not available through BYOK; requires a GitHub account and Copilot plan |
| Copilot sessions on the agent host (Agents window) | BYOK models are experimental there | Enable chat.agentHost.byokModels.enabled; the feature may change |

## Which model ID should GitHub Copilot send?

Copy the exact model ID from /models, preserving case, hyphens, and version suffixes; do not substitute a display name. Open its detail page and match the supported API endpoints, context window, and capabilities such as tool calling to the provider and features selected in GitHub Copilot. A catalog listing does not mean the client can use every feature of that model. Give each tool a dedicated API key with a maxSpend cap.

## Which API protocol is GitHub Copilot using?

OpenAI-compatible describes an interface format; it does not make Chat Completions (/v1/chat/completions), Responses (/v1/responses), and Anthropic Messages (/v1/messages) interchangeable. Check the installed client version, provider configuration, and actual request path against the model detail page and API compatibility fact sheet. A successful plain-text chat does not establish support for hosted tools, conversation state, or file-editing features.

## Verify the GitHub Copilot call in your request trace

Send a simple text request from GitHub Copilot, then match its trace in Dashboard → Logs by time, model, and request_id: tokens, cost, latency, and status. Next, test streaming, tool calls, and multi-turn history separately. For failures, retain the actual request path, full error message, and request_id. If there is no matching log, check client configuration and connectivity before attributing the error to the gateway or upstream.

## FAQ

### Do I need a Copilot subscription to use Router One models in VS Code Copilot Chat?

No. The VS Code docs state that BYOK models work without signing into a GitHub account and without a Copilot plan, so a Router One key alone unlocks chat and agent workflows. What a plan still buys is the Copilot-hosted features: inline suggestions, semantic search, embeddings, and the built-in utility models. On Copilot Business or Enterprise the organization must leave the Bring Your Own Language Model Key in VS Code policy enabled; GitHub's April 2026 changelog says it is enabled by default and that an administrator can turn it off.

### I added the model, but it is missing from the picker, or hidden when I use an agent. What should I check?

Three checks, in order. First, restart VS Code: the docs note that a newly added model may not appear until you do. Second, open the Language Models editor and confirm the model is visible (eye icon) rather than hidden. Third, when you use agents in chat, VS Code lists only models with toolCalling: true in chatLanguageModels.json, and that flag is a declaration you make, not a capability VS Code detects — confirm on the model's detail page that it supports tool calling on /v1/chat/completions, then run one agent turn and look for the tool call in the trace.

### Can I use the Responses or Messages API type instead of Chat Completions?

Yes, but only for models whose detail page lists that endpoint, and with the matching full URL: https://api.router.one/v1/responses with apiType responses for the GPT-family models served natively on Responses, or https://api.router.one/v1/messages with apiType messages for Claude-family models. Set apiType per model when one group mixes types. VS Code also switches the auth header with the type — Bearer for Chat Completions and Responses, x-api-key for Messages — and Router One accepts both. Chat Completions is the one type that serves every chat model in the catalog, which is why this guide starts there; a model sent to an endpoint it does not serve returns a 400 whose message names the correct path.

### Which models can GitHub Copilot use through the gateway?

Choose a current catalog model that supports both the endpoint and the features GitHub Copilot uses. Check /models and the model detail page for the exact ID, current rates, and capabilities; a family name such as GPT or Claude is not a compatibility guarantee. Seeing a model in the picker confirms discovery, so verify an actual request too.

### Models are listed, but requests fail with 400 or 404. What should I check?

Record the actual request path and error message, then check the exact model ID. A 400 can indicate invalid parameters, unsupported tools, or a model/endpoint mismatch; a 404 can indicate an incorrect path or missing resource, so it does not by itself establish that a model was retired. If the error says must be called via, use the named endpoint or select a model supported on the current endpoint. Do not add or remove /v1 or /chat/completions across all clients indiscriminately.

### Does this work from Mainland China?

Yes. The gateway is reachable from Mainland China without a VPN, and the configuration is identical to the global setup.

### How do I debug a 401/402/403/429?

Match the request and error message in Dashboard → Logs. For 401, check whether the key was sent and is valid; for 402, check wallet balance and maxSpend; for 403, check key permissions and access restrictions. For 429, distinguish request/token limits from upstream throttling using the error details. Keep the request_id and follow the error-codes reference.

## See also

- All integration guides: https://router.one/integrations
- Debug API errors in GitHub Copilot: https://router.one/llm-api-error-codes
- API compatibility: endpoints and supported features: https://router.one/facts/api-compatibility.md
- Responses API setup and limits: https://router.one/codex-responses-api
- OpenHands setup: https://router.one/integrations/openhands
- NextChat setup: https://router.one/integrations/nextchat
- Continue setup (VS Code and JetBrains): https://router.one/integrations/continue
- Cursor setup: https://router.one/integrations/cursor
- One gateway behind every coding tool: https://router.one/use-cases/ai-coding-tools
- VS Code docs: AI language models and BYOK: https://code.visualstudio.com/docs/agent-customization/language-models
- VS Code 1.122 release notes: Custom Endpoint provider in Stable: https://code.visualstudio.com/updates/v1_122
- GitHub changelog: BYOK in VS Code for Business and Enterprise: https://github.blog/changelog/2026-04-22-bring-your-own-language-model-key-in-vs-code-now-available/
- What the gateway layer does: https://router.one/llm-api-gateway
- OpenAI-compatible API: https://router.one/openai-compatible-api
- API docs: https://router.one/docs
- Canonical page: https://router.one/integrations/github-copilot
- Models and per-model token rates: https://router.one/models (markdown: https://router.one/models.md)
- Pricing: https://router.one/pricing
- API docs (markdown): https://router.one/docs.md
- Company facts: https://router.one/facts/company.md
