Skip to content

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

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

  1. 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)
  2. Click Add Models → Custom Endpoint
  3. Enter a group name (e.g. Gateway), then paste your LLM API key
  4. Choose Chat Completions as the API type
  5. VS Code opens chatLanguageModels.json with your group already filled in. Keep the values VS Code wrote, and add each model you want under models:
{
  "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.

  1. 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.json is valid JSON and the model id matches 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": true on the model. Agent mode needs tool calling.