Use TeamoRouter in VS Code GitHub Copilot Chat: Custom Endpoint (Bring Your Own Key)
GitHub Copilot Chat in VS Code supports Bring Your Own Key (BYOK): add a Custom Endpoint with your TeamoRouter API key and endpoint URL, and Claude, GPT and other models show up in chat and agent mode. Custom Endpoint supports three API types — Chat Completions, Responses and Anthropic Messages — and TeamoRouter serves all three.
New accounts start with a $0 balance — top up before your first request. Top up from $5. If a request returns 402 with "wallet balance is insufficient", your balance is empty — your endpoint URL and key are fine. Top up and retry.
1. Before you start
- Update VS Code to a current version. Custom Endpoint replaces the old "OpenAI Compatible" provider and the
github.copilot.chat.customOAIModelssetting. - Create an API key in the TeamoRouter dashboard.
- In Local sessions, BYOK models work without signing in to GitHub and without a Copilot plan. On Copilot Business or Enterprise, your admin may have turned off BYOK on GitHub, so check first.
2. Add a Custom Endpoint
- In the Chat view, open the model picker and select the gear (Manage Language Models), or run
Chat: Manage Language Modelsfrom the Command Palette. - Select Add Models, then Custom Endpoint.
- Enter
TeamoRouteras the group name (the label the model picker groups by). - Enter any display name, and paste your TeamoRouter key as the API key.
- Pick Messages as the API type (for Claude models). You can override it per model, as shown below.
- VS Code opens
chatLanguageModels.json. Keep theapiKeyline it generated, changemodelsto the following, and save:
[
{
"name": "TeamoRouter",
"vendor": "customendpoint",
"apiKey": "(keep the line VS Code generated)",
"apiType": "messages",
"models": [
{
"id": "claude-sonnet-5-5",
"name": "Claude Sonnet 5.5 · TeamoRouter",
"url": "https://api.teamorouter.com/v1/messages",
"apiType": "messages",
"toolCalling": true,
"vision": true,
"contextWindow": 1000000,
"maxOutputTokens": 32000
},
{
"id": "claude-opus-5-5",
"name": "Claude Opus 5.5 · TeamoRouter",
"url": "https://api.teamorouter.com/v1/messages",
"apiType": "messages",
"toolCalling": true,
"vision": true,
"contextWindow": 1000000,
"maxOutputTokens": 32000
},
{
"id": "gpt-6.1-sol",
"name": "GPT-6.1 Sol · TeamoRouter",
"url": "https://api.teamorouter.com/v1/responses",
"apiType": "responses",
"statefulResponses": false,
"toolCalling": true,
"vision": true,
"contextWindow": 1000000,
"maxOutputTokens": 32000
}
]
}
]
- Back in chat, pick a model from the TeamoRouter group in the model picker. If it doesn't appear, restart VS Code.
3. Which API type to use
| Models | apiType |
url |
|---|---|---|
| Claude | messages |
https://api.teamorouter.com/v1/messages |
| GPT | responses (plus "statefulResponses": false) |
https://api.teamorouter.com/v1/responses |
| Other OpenAI-compatible models | chat-completions |
https://api.teamorouter.com/v1/chat/completions |
- Give the full endpoint URL (ending in
/messages,/responsesor/chat/completions); VS Code uses it as is. - Add
"statefulResponses": falsefor the Responses API. By default VS Code sends only new messages and relies onprevious_response_id; turning it off sends the full conversation each time and avoids errors about missing tool calls. - To add another model, copy a block and change
idandname. Model IDs are in the model catalog. Agent mode lists only models withtoolCallingset totrue.
Troubleshooting
- Inline completions (Tab) still need GitHub: BYOK covers chat and small background jobs such as title generation. Inline suggestions, semantic search and similar features still need a GitHub account.
- The model doesn't show in the picker: make sure
chatLanguageModels.jsonis saved and is valid JSON, then restart VS Code. - Requests return 401: the key is wrong or was deleted. Edit the group in Language Models and paste the key again.
- You use OpenAI's Codex extension, not Copilot: the Codex extension reads
~/.codex/config.toml. Set it up with the Codex CLI guide.