Connect gair to VS Code Copilot BYOK
How to connect gair using the BYOK (bring your own key) feature built into VS Code's Copilot Chat. A single project SK is all you need — no other keys are required.
📋 Before you start
- VS Code 1.122 or later — the Custom Endpoint option was added in this version.
- A GIIP project and its SK — if you do not have one yet, see "Before you start" in the gair connection guide first. Projects and SKs are issued by the GIIP operator.
🚀 Setup steps
- Open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P) and run Chat: Manage Language Models.
- Choose Add Models... and select Custom Endpoint.
- Enter
gairas the group name, paste your SK into the API key field, and choose Messages as the API type. VS Code stores the key in its secret storage, so it is never written into the file directly. - In the
chatLanguageModels.jsonfile that opens, fill in the model entry as shown below. - Save, then pick gair from the model list in Copilot Chat.
[
{
"name": "gair",
"vendor": "customendpoint",
"apiType": "messages",
"models": [
{
"id": "claude-sonnet-5-5",
"name": "gair",
"url": "https://giipfaw.azurewebsites.net/api/gair/v1/messages",
"toolCalling": true,
"vision": true
}
]
}
]
📌 Key point — the url must be the full message path
Unlike other development tools, this option needs the full message path (.../api/gair/v1/messages), not just the base URL (.../api/gair). With only the base URL, the request never arrives and you get an error.
📃 Model names
For id, use a model alias that gair accepts. These are the six aliases gair currently accepts.
| Alias |
|---|
claude-opus-5-5 |
claude-sonnet-5-5 |
claude-haiku-4-5 |
claude-opus-4-8 |
MiniMax-M3.1-Flash |
MiniMax-M3 |
You can check the current list at any time with GET https://giipfaw.azurewebsites.net/api/gair/v1/models (SK authentication required; the lookup is not recorded as usage).
The name you pick here is only a starting point. gair judges each request and decides which model actually responds, so the responding model may differ from the name you selected — that is expected.
✅ Check the connection
Pick gair in Copilot Chat and send a short message. If you get a normal reply, you are connected. Usage is recorded per project and can be checked in the GIIP console.
🛠️ Troubleshooting
| Symptom | What to check |
|---|---|
| Authentication error (401) | Make sure the SK was pasted correctly. If you created the group without entering the key, enter it again from the model management screen. |
| Access denied (403) | gair access is not enabled for that project. Ask the operator to enable gair access for the project. |
| Address error (404, etc.) | Make sure url is the full path https://giipfaw.azurewebsites.net/api/gair/v1/messages. This option does not work with the base URL alone. |
| The model does not appear in the picker | Make sure you saved chatLanguageModels.json and restart VS Code. Also check that the group name and vendor are set to customendpoint. |
| The responding model differs from the one picked | This is expected. gair judges the request content and decides which model actually responds. |