Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/ai-coder/ai-gateway/clients/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. |
Expand Down
103 changes: 60 additions & 43 deletions docs/ai-coder/ai-gateway/clients/vscode.md
Original file line number Diff line number Diff line change
@@ -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 `<your-coder-api-token>` 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": "<your-coder-api-token>",
"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)
Loading