From 96013b4ac1069f3811204e23a1bbec9b259e12e5 Mon Sep 17 00:00:00 2001 From: Atif Ali Date: Mon, 8 Jun 2026 12:35:20 +0500 Subject: [PATCH] docs(docs/ai-coder/ai-gateway/clients): update VS Code to reflect 1.122 Custom Endpoint support (#26126) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updates the VS Code AI Gateway client docs to reflect the Custom Endpoint provider introduced in VS Code 1.121 (Insiders) and promoted to Stable in 1.122. ## Changes **`docs/ai-coder/ai-gateway/clients/vscode.md`** - Replace the deprecated `customoai` vendor with `customendpoint` - Add the required `apiType` field (`responses` for OpenAI, `messages` for Anthropic) - Add Anthropic provider setup (Messages API type, base URL `…/aibridge/anthropic`) - Note GitHub sign-in is no longer required — works in air-gapped/restricted environments - Add limitation callout: inline suggestions and NES still require GitHub Copilot - Reflect the UI-first API key entry flow (VS Code stores the token securely; do not paste into JSON directly) - Drop the Centralized/BYOK split — VS Code has no template injection path, so both scenarios follow the same user-driven UI flow **`docs/ai-coder/ai-gateway/clients/index.md`** - VS Code compatibility row: Anthropic `❌ → ✅` - Updated Notes column
Research notes - VS Code 1.121 shipped the Custom Endpoint provider (Insiders), replacing the legacy OpenAI Compatible (`customoai`) provider which is now deprecated. - VS Code 1.122 promoted Custom Endpoint to Stable and removed the GitHub sign-in requirement for BYOK. - Anthropic support confirmed working: `apiType: "messages"` + base URL `…/api/v2/aibridge/anthropic` (Coder's gateway accepts the Coder session token as `x-api-key`). - OpenAI uses `apiType: "responses"` + base URL `…/api/v2/aibridge/openai`. - API keys must be entered via the Manage Language Models UI — VS Code stores them securely and references them as `${input:chat.lm.secret.XXXXX}` in the JSON.
> This PR was drafted by Coder Agents on behalf of @matifali. (cherry picked from commit 2211f9ce4bd697d00afc160607f922eaaf1f1cca) --- docs/ai-coder/ai-gateway/clients/index.md | 2 +- docs/ai-coder/ai-gateway/clients/vscode.md | 103 ++++++++++++--------- 2 files changed, 61 insertions(+), 44 deletions(-) diff --git a/docs/ai-coder/ai-gateway/clients/index.md b/docs/ai-coder/ai-gateway/clients/index.md index 2020df10bf72c..a07752f90a61a 100644 --- a/docs/ai-coder/ai-gateway/clients/index.md +++ b/docs/ai-coder/ai-gateway/clients/index.md @@ -44,7 +44,7 @@ The table below shows tested AI clients and their compatibility with AI Gateway. | [Factory](./factory.md) | ✅ | ✅ | ✅ | | | [Cline](./cline.md) | ✅ | ✅ | ✅ | | | [Kilo Code](./kilo-code.md) | ✅ | ✅ | ❌ | | -| [VS Code](./vscode.md) | ✅ | ❌ | ❌ | Only supports Custom Base URL for OpenAI. | +| [VS Code](./vscode.md) | ✅ | ✅ | ❌ | VS Code 1.122+ via Custom Endpoint provider. GitHub sign-in not required. Inline suggestions still require GitHub Copilot. | | [JetBrains IDEs](./jetbrains.md) | ✅ | ❌ | ❌ | Works in Chat mode via [third-party model configuration](https://www.jetbrains.com/help/ai-assistant/use-custom-models.html#provide-your-own-api-key). | | [Zed](./zed.md) | ✅ | ✅ | ❌ | | | [GitHub Copilot](./copilot.md) | ⚙️ | - | - | Requires [AI Gateway Proxy](../ai-gateway-proxy/index.md). Uses per-user GitHub tokens. | diff --git a/docs/ai-coder/ai-gateway/clients/vscode.md b/docs/ai-coder/ai-gateway/clients/vscode.md index d27a61459bbb3..def380b74f9d7 100644 --- a/docs/ai-coder/ai-gateway/clients/vscode.md +++ b/docs/ai-coder/ai-gateway/clients/vscode.md @@ -1,60 +1,77 @@ -# VS Code > [!NOTE] > AI Gateway requires the [AI Governance Add-On](../../ai-governance.md). > As of Coder v2.32, deployments without the add-on will not be able to > access AI Gateway. -VS Code's native chat can be configured to use AI Gateway with the GitHub Copilot Chat extension's custom language model support. +VS Code's native chat can be configured to use AI Gateway via the **Custom Endpoint** language model provider (VS Code 1.122+, Stable). GitHub sign-in is not required, so this works in air-gapped or restricted environments. -## Centralized API Key +## Setup + +Requires VS Code 1.122+ and the [GitHub Copilot Chat extension](https://marketplace.visualstudio.com/items?itemName=GitHub.copilot-chat). + +For each provider below, the setup steps are: + +1. Open the Command Palette (`Ctrl+Shift+P` / `Cmd+Shift+P` on Mac) and run **Chat: Manage Language Models**. +1. Select **Add** → **Custom Endpoint**. +1. Enter a **group name**, **display name**, your **[Coder API token](../../../admin/users/sessions-tokens.md#generate-a-long-lived-api-token-on-behalf-of-yourself)** as the API key, and the **API type** shown below. +1. To add or edit models, select the gear icon next to the provider in the Language Models view to open `chatLanguageModels.json`. > [!IMPORTANT] -> You need the **Pre-release** version of the [GitHub Copilot Chat extension](https://marketplace.visualstudio.com/items?itemName=GitHub.copilot-chat) and [VS Code Insiders](https://code.visualstudio.com/insiders/). +> Enter your API token through the UI. VS Code stores it securely and inserts a reference like `${input:chat.lm.secret.XXXXX}` into the JSON. Do not paste your token directly into the JSON file. + +_Replace `coder.example.com` with your Coder deployment URL. Model IDs must match what is configured in your AI Gateway._ + +### OpenAI-compatible models -1. Open command palette (`Ctrl+Shift+P` or `Cmd+Shift+P` on Mac) and search for _Chat: Open Language Models (JSON)_. -1. Paste the following JSON configuration, replacing `` with your **[Coder API token](../../../admin/users/sessions-tokens.md#generate-a-long-lived-api-token-on-behalf-of-yourself)**: +Set **API type** to `responses`. ```json -[ - { - "name": "Coder", - "vendor": "customoai", - "apiKey": "", - "models": [ - { - "name": "GPT 5.2", - "url": "https://coder.example.com/api/v2/aibridge/openai/v1/chat/completions", - "toolCalling": true, - "vision": true, - "thinking": true, - "maxInputTokens": 272000, - "maxOutputTokens": 128000, - "id": "gpt-5.2" - }, - { - "name": "GPT 5.2 Codex", - "url": "https://coder.example.com/api/v2/aibridge/openai/v1/responses", - "toolCalling": true, - "vision": true, - "thinking": true, - "maxInputTokens": 272000, - "maxOutputTokens": 128000, - "id": "gpt-5.2-codex" - } - ] - } -] +{ + "name": "Coder (OpenAI)", + "vendor": "customendpoint", + "apiKey": "${input:chat.lm.secret.XXXXX}", + "apiType": "responses", + "models": [ + { + "id": "gpt-5.5", + "name": "GPT 5.5", + "url": "https://coder.example.com/api/v2/aibridge/openai", + "toolCalling": true, + "vision": true, + "thinking": true, + "streaming": true, + "maxInputTokens": 272000, + "maxOutputTokens": 128000 + } + ] +} ``` -_Replace `coder.example.com` with your Coder deployment URL._ +### Anthropic models -> [!NOTE] -> The setting names may change as the feature moves from pre-release to stable. Refer to the official documentation for the latest setting keys. - -## BYOK (Personal API Key) +Set **API type** to `messages`. -> [!NOTE] -> At the time of writing, GitHub Copilot Chat does not support sending custom headers, so BYOK mode is not available. +```json +{ + "name": "Coder (Anthropic)", + "vendor": "customendpoint", + "apiKey": "${input:chat.lm.secret.XXXXX}", + "apiType": "messages", + "models": [ + { + "id": "claude-sonnet-4.6", + "name": "Claude Sonnet 4.6", + "url": "https://coder.example.com/api/v2/aibridge/anthropic", + "toolCalling": true, + "vision": true, + "thinking": true, + "streaming": true, + "maxInputTokens": 1000000, + "maxOutputTokens": 64000 + } + ] +} +``` -**References:** [GitHub Copilot - Bring your own language model](https://code.visualstudio.com/docs/copilot/customization/language-models#_add-an-openaicompatible-model) +**References:** [VS Code - Bring your own language model](https://code.visualstudio.com/docs/copilot/customization/language-models)