Use VS Code with the Gateway¶
VS Code lets you bring your own language models to chat and agent mode with its built-in Custom Endpoint provider. Connect it to the Gateway to use Claude and other models through your regional endpoint.
Prerequisites¶
- VS Code (current release)
- An LLM API key
You don't need an extension, a Copilot plan, or a GitHub sign-in to use your own models in chat.
Connect VS Code to the Gateway¶
- In the Chat view, click the gear icon in the chat input and choose Manage Language Models (or run Chat: Manage Language Models from the Command Palette)
- Click Add Models → Custom Endpoint
- Enter a group name (e.g.
Gateway), then paste your LLM API key - Choose Chat Completions as the API type
- VS Code opens
chatLanguageModels.jsonwith your group already filled in. Keep the values VS Code wrote, and add each model you want undermodels:
{
"id": "claude-4-5-sonnet",
"name": "Claude Sonnet 4.5 (Gateway)",
"url": "https://llm.[your-region].amazee.ai/v1/chat/completions",
"toolCalling": true,
"vision": true,
"maxInputTokens": 200000,
"maxOutputTokens": 16384
}
Replace [your-region] with your region code (e.g. ch103, us103). Use model IDs exactly as the Gateway lists them. See Available Models.
- Save the file. The model appears in the chat model picker for Ask and Agent mode.
Verify¶
Open a chat, select a Gateway model from the picker, and ask a question. Check the My usage card on the AI keys page to confirm.
Notes¶
- Your own models work in chat and agent mode. Code completions (inline suggestions), semantic search, and embeddings still use GitHub's models, need a GitHub account, and don't go through the Gateway.
- On Copilot Business or Enterprise, an admin must turn on the Bring Your Own Language Model Key in VS Code policy.
Troubleshooting¶
- Model not showing in picker
- Check
chatLanguageModels.jsonis valid JSON and the modelidmatches the Gateway exactly. Reopen Manage Language Models to confirm the group is listed. - Auth errors
- Verify your API key and the model
url. It should use your key's region. - Model can't be used in Agent mode
- Set
"toolCalling": trueon the model. Agent mode needs tool calling.