VS Code (GitHub Copilot Chat) Setup
Connect VS Code GitHub Copilot Chat to Tokenfly
Installation
Download and install VS Code from the VS Code website, then search for and install the GitHub Copilot Chat extension from the marketplace.
Configure a Custom Model Endpoint
-
Open the Chat panel, click the model picker button next to the input box, and select Manage Models from the menu.
-
Click Add Model, then choose Custom Endpoint.
-
Enter a group name (the group name shown in the model picker, e.g.
Tokenfly). -
Enter a display name and API Key:
sk-xxx. -
Select Chat Completions as the API type.
-
VS Code will automatically open
chatLanguageModels.json— fill in the model details:[ { "name": "Tokenfly", "vendor": "customendpoint", "apiKey": "sk-xxx", "apiType": "chat-completions", "models": [ { "id": "gpt-5.4", "name": "GPT-5.4", "url": "https://tokenfly.com/v1/chat/completions", "toolCalling": true, "maxInputTokens": 900000, "maxOutputTokens": 100000 } ] } ] -
Save the file, then select
GPT-5.4in the Chat panel's model picker to use it.
Configuration Reference
| Field | Purpose |
|---|---|
vendor | Fixed value customendpoint |
apiKey | Access token |
apiType | API protocol type; the gateway is OpenAI-compatible, use chat-completions |
models[].id | Model name sent to the gateway on request |
models[].url | Full request URL |
models[].toolCalling | Whether tool calling is supported; must be true for Agent mode |
models[].maxInputTokens / maxOutputTokens | Context window size; adjust to match actual values if different |
Verification
Select GPT-5.4 in the model picker and start a conversation — a normal reply confirms the setup works. If the newly added model doesn't appear immediately in the picker, restart VS Code.
How is this guide?