# VS Code Agents Window Setup

> Connect LLMoxy in the VS Code Agents window with a custom endpoint, API key, and model IDs, and enable BYOK models for Agent Host sessions.

Download: [https://code.visualstudio.com/](https://code.visualstudio.com/)

Official references: [AI language models in VS Code](https://code.visualstudio.com/docs/agent-customization/language-models), [Use the Agents window](https://code.visualstudio.com/docs/copilot/agents/agents-window)

> **📌 About the Agents window**
> The Agents window is a dedicated agent workspace in VS Code. This page only covers connecting LLMoxy as a model provider.

## Prerequisites

- [VS Code](https://code.visualstudio.com/) installed (current Stable or Insiders)
- An LLMoxy API token — see [Get a token](https://en.llmoxy.com/docs/get-started/get-token)
- Use a **default** group token for GPT text models. Do not mix image-generation keys.

| Field | Value |
| --- | --- |
| Gateway | `https://llmoxy.com` |
| Chat Completions | `https://llmoxy.com/v1/chat/completions` |
| API Key | Token from the console |
| Recommended models | `gpt-6-astra`, `grok-4.7` |

Agent sessions require tool calling. Set `toolCalling` to `true`, or the model will not appear in the Agents window picker.

## Open the Agents window

- Select **Open in Agents** in the title bar
- Command Palette (`Ctrl+Shift+P` / `⌘⇧P`) → **Chat: Open Agents Window**
- Terminal: `code --agents`

![Agents window](https://en.llmoxy.com/docs-assets/tutorial-vscode-agents/agents-window.png)

When you start a session, pick the workspace, harness, and language model in the input area.

![New session input](https://en.llmoxy.com/docs-assets/tutorial-vscode-agents/new-session.png)

## Allow Agent Host to use your own models

Agent Host sessions in this window need an extra setting for BYOK models.

1. Open Settings (`Ctrl+,` / `⌘,`)
2. Search for `agentHost.byok`
3. Enable **Chat > Agent Host: Byok Models Enabled** (`chat.agentHost.byokModels.enabled`)

To use LLMoxy without GitHub sign-in, also enable **Chat > Agent Host: Allow Signed Out When Usable** (`chat.agentHost.allowSignedOutWhenUsable`).

Or add to `settings.json`:

```json
{
  "chat.agentHost.byokModels.enabled": true,
  "chat.agentHost.allowSignedOutWhenUsable": true
}
```

> **💡 Tip**
> Both settings are off by default. Without them, LLMoxy models can show up in Chat but not in the Agents window.

## Add an LLMoxy custom endpoint

Use **Custom Endpoint**. Do not use the deprecated OpenAI Compatible provider.

### 1. Open Language Models

Open the model picker in Chat or the Agents window, select the gear **Manage Language Models**, or run **Chat: Manage Language Models**.

![Model picker in chat](https://en.llmoxy.com/docs-assets/tutorial-vscode-agents/model-picker.png)

![Language Models editor](https://en.llmoxy.com/docs-assets/tutorial-vscode-agents/language-models-editor.png)

### 2. Add Custom Endpoint

1. Select **Add Models**
2. Select **Custom Endpoint**
3. Group name: `LLMoxy`
4. Enter a display name and your LLMoxy API key
5. API type: **Chat Completions**

![Add model provider](https://en.llmoxy.com/docs-assets/tutorial-vscode-agents/add-provider.png)

### 3. Edit chatLanguageModels.json

VS Code opens `chatLanguageModels.json`. Save something like:

```json
[
  {
    "name": "LLMoxy",
    "vendor": "customendpoint",
    "apiKey": "${input:llmoxyApiKey}",
    "apiType": "chat-completions",
    "models": [
      {
        "id": "gpt-6-astra",
        "name": "GPT-6 Astra",
        "url": "https://llmoxy.com/v1/chat/completions",
        "apiType": "chat-completions",
        "toolCalling": true,
        "vision": true,
        "thinking": true,
        "maxInputTokens": 922000,
        "maxOutputTokens": 128000,
        "supportsReasoningEffort": ["low", "medium", "high", "xhigh", "max"],
        "reasoningEffortFormat": "chat-completions"
      },
      {
        "id": "grok-4.7",
        "name": "Grok 4.7",
        "url": "https://llmoxy.com/v1/chat/completions",
        "apiType": "chat-completions",
        "toolCalling": true,
        "vision": true,
        "thinking": true,
        "maxInputTokens": 500000,
        "maxOutputTokens": 128000
      }
    ]
  }
]
```

After saving, **GPT-6 Astra** and **Grok 4.7** should appear in the picker. Restart VS Code if they do not.

## Switch models in the Agents window

1. Open the Agents window and start or select a session
2. Pick the LLMoxy model in the input picker
3. For reasoning models, open **>** next to the name and set Thinking Effort

![Thinking Effort submenu](https://en.llmoxy.com/docs-assets/tutorial-vscode-agents/thinking-effort.png)

The picker label becomes something like `GPT-6 Astra · High`.

> **⚠️ Notes**
> In Restricted Mode the picker only shows **Auto**. Trust the workspace first.
> Copilot Business / Enterprise admins may need to enable **Bring Your Own Language Model Key in VS Code**.

## Troubleshooting

- **No LLMoxy model in the Agents window**: enable `chat.agentHost.byokModels.enabled` and set `toolCalling` to `true`
- **422 / model not found**: `id` must match the console, e.g. `gpt-6-astra`, `grok-4.7`
- **401 / Invalid token**: no extra spaces in the key; check the key is enabled and has quota
- **Wrong URL**: set API type to **Chat Completions** and `url` to `https://llmoxy.com/v1/chat/completions`
- **Image key used for chat**: use a separate key from the GPT Image group for image models

This is the markdown version of https://en.llmoxy.com/docs/code-tutorials/vscode-agents.
