Skip to main content
GitHub Copilot Chat in VS Code supports Bring Your Own Key (BYOK) through a Custom Endpoint provider. Pointing it at the AI Gateway routes Chat requests through Orq.ai, reaching the full model catalog with unified tracing, cost tracking, and access controls.
Always use the provider/model_id format for the model id value (e.g. anthropic/claude-sonnet-4-6, not claude-sonnet-4-6). Bare IDs return a 400 invalid model format error.

Prerequisites

  • VS Code 1.122 or later (the Custom Endpoint provider graduated from Insiders to stable in this release) with the GitHub Copilot Chat extension installed
  • Active Orq.ai account
  • Orq.ai API key
  • Copilot Business or Enterprise orgs: an administrator must enable Bring Your Own Language Model Key in VS Code in the Copilot policy settings on GitHub.com
BYOK covers Chat and tool calls only. Inline suggestions, next-edit suggestions, and semantic search still require GitHub sign-in and are not routed through Orq.ai.

Setup

1

Open Manage Language Models

Run Chat: Manage Language Models from the Command Palette, or select the gear icon labeled Manage Language Models in the Chat model picker.
2

Add a Custom Endpoint provider

Select Add Models, then choose Custom Endpoint from the provider list. VS Code prompts for three things in sequence:
  • Group name: any label, e.g. Orq.ai.
  • API key: the Orq.ai API key.
  • API Type: Responses, Chat Completions, or Messages, matching one of the tabs below.
VS Code then opens the global chatLanguageModels.json file, in the VS Code user data directory, not the project workspace, with the group already scaffolded. The API key is stored as a secret reference ("apiKey": "${input:chat.lm.secret...}"), not the raw key; leave that field as generated.
3

Add a model to the group

chatLanguageModels.json is an array of groups. Add an entry to the scaffolded group’s models array:
4

Select the model in Copilot Chat

Open the Chat model picker and select a model from the new group to start using it.
Chat model picker showing GPT-5.4 via Orq selected under the Orq.ai group, alongside built-in models and a Manage Models option.

Configuration Reference

chatLanguageModels.json is an array of provider groups.

Troubleshooting

The secret behind apiKey is likely wrong or expired. Reopen Manage Language Models, remove the group, and re-add it, pasting a valid Orq.ai API key (not a GitHub, OpenAI, or Anthropic key) at the prompt.
Set the model id to the provider/model_id format (e.g. anthropic/claude-sonnet-4-6). Bare model IDs are rejected by the router.
Confirm url points to a full endpoint path, not just a base URL. https://api.orq.ai/v3/router alone is rejected; use https://api.orq.ai/v3/router/responses or https://api.orq.ai/v3/router/chat/completions.
Confirm url matches apiType: responses must point to https://api.orq.ai/v3/router/responses, chat-completions must point to https://api.orq.ai/v3/router/chat/completions, messages must point to https://api.orq.ai/v3/anthropic/v1/messages. Requests sent to the wrong endpoint will not appear in Orq.ai Traces.
BYOK only applies to Chat and tool calls. Inline suggestions, next-edit suggestions, and semantic search continue to require GitHub sign-in and are not affected by the Custom Endpoint configuration.
On a Copilot Business or Enterprise account, Manage Language Models does not exist as a command until an administrator enables Bring Your Own Language Model Key in VS Code in the Copilot policy settings on GitHub.com. The Command Palette falls back to the similarly named Manage Language Model Access command instead, which controls extension permissions and is unrelated to BYOK. Ask a workspace administrator to enable the policy, then reload VS Code.
The Custom Endpoint provider requires VS Code 1.122 or later; earlier versions only show built-in providers (Anthropic, Azure, Google, Ollama, OpenAI, OpenRouter, xAI). Update VS Code via Code → Check for Updates (macOS) or Help → Check for Updates, then reopen Manage Language Models.
Expected the first time a BYOK model is used as the active main model. Open Settings (Cmd+,), search utility, and set Chat: Byok Utility Model Default to one of the configured Custom Endpoint models.

Verification

Select the configured model in the Chat model picker and send a message. The response appears in Copilot Chat and the trace appears in Orq.ai Traces with the model identifier set in id.