# VS Code

Native Custom Endpoint in a Local chat session; independent of Codex/Claude/Cline.

Source: https://zrelay.net/docs/agents/coding-agents/vscode/

## Manual setup

1. In desktop VS Code run Chat: Manage Language Models > Add Models > Custom Endpoint. Name it Zrelay, enter the key only through the local input, and choose Responses. Preserve other providers and logins.

2. In the chatLanguageModels.json opened by VS Code, preserve the generated apiKey input reference. Merge the JSON model object below into only the new provider models list; it is not a replacement for the entire file.

3. Save, open a Local session, and select Zrelay GPT. Use a GPT Flex/Prime key for gpt-6.1-sol Responses. statefulResponses:false avoids reliance on stored server conversations; toolCalling:true declares capability without proving a tool loop.

4. Other native routes: claude-sonnet-5-5 with apiType messages and URL https://api.zrelay.net/v1/messages, or grok-4.7-latest with chat-completions and URL https://api.zrelay.net/v1/chat/completions. Remove statefulResponses for these; retain conservative vision:false and the published limits. Use their matching keys.

## Configuration and commands

```
{
  "id": "gpt-6.1-sol",
  "name": "Zrelay GPT",
  "url": "https://api.zrelay.net/v1/responses",
  "apiType": "responses",
  "statefulResponses": false,
  "toolCalling": true,
  "vision": false,
  "maxInputTokens": 128000,
  "maxOutputTokens": 4096
}
```

## Alternative: ask an AI assistant

Copy this complete prompt into your coding assistant. It describes configuration work; installation and paid tests need your authorization.

```
Set up Zrelay in my existing desktop VS Code using its native Custom Endpoint provider and a Local chat session. Detect OS, VS Code version and active profile. Consult https://code.visualstudio.com/docs/agent-customization/language-models and https://keys.zrelay.net/api/catalog. Preserve all existing providers, settings and logins. Prefer gpt-6.1-sol with Responses at https://api.zrelay.net/v1/responses if enabled for my key's pool; use the catalog's exact limits (currently 128000 input, 4096 output), statefulResponses:false, toolCalling:true and conservative vision:false. Guide me through Chat: Manage Language Models > Add Models > Custom Endpoint. I will enter the key locally; never ask me to paste it into chat, read it out, log it or commit it. Preserve the generated apiKey input reference and merge only the new model. Validate JSON and supported settings without paid calls. Do not claim streaming/tools work without testing. Ask for explicit consent before installing/updating software or making paid inference requests. Explain any version/policy blocker and give the exact remaining manual step.
```

## Limits and verification

Organization policy/version may block BYOK. It does not configure Tab/inline completion, cloud agents or other harnesses. Current VS Code Chat Completions code drops max_tokens: maxOutputTokens metadata alone does not prove a transmitted Grok budget. Responses/Messages retain their output fields. Production normalization and runtime streaming/tools were not tested.

These recipes were reviewed against documentation and public catalog data. No client installation, authenticated request, paid inference, streaming or tool loop was executed. Validate configuration first; a later short text test does not establish complete agent compatibility.

Recheck the [live catalog](https://keys.zrelay.net/api/catalog) and your key’s provider/pool. The reviewed examples have 128000 input and 4096 output maxima unless a client limitation above prevents controlling the request. Never print, log or commit credentials.

## Official sources

Documentation checked 2026-11-09; mutable sources can differ from your installed version.

[https://code.visualstudio.com/docs/agent-customization/language-models](https://code.visualstudio.com/docs/agent-customization/language-models)

[https://keys.zrelay.net/api/catalog](https://keys.zrelay.net/api/catalog)

[https://code.visualstudio.com/blogs/2026/06/18/byok-vscode](https://code.visualstudio.com/blogs/2026/06/18/byok-vscode)

[https://code.visualstudio.com/docs/agents/run/agent-harnesses](https://code.visualstudio.com/docs/agents/run/agent-harnesses)

[https://github.com/microsoft/vscode/blob/main/extensions/copilot/src/extension/byok/vscode-node/customEndpointProvider.ts](https://github.com/microsoft/vscode/blob/main/extensions/copilot/src/extension/byok/vscode-node/customEndpointProvider.ts)

[https://raw.githubusercontent.com/microsoft/vscode/main/extensions/copilot/src/extension/byok/node/openAIEndpoint.ts](https://raw.githubusercontent.com/microsoft/vscode/main/extensions/copilot/src/extension/byok/node/openAIEndpoint.ts)

[https://raw.githubusercontent.com/microsoft/vscode/main/extensions/copilot/src/platform/endpoint/node/responsesApi.ts](https://raw.githubusercontent.com/microsoft/vscode/main/extensions/copilot/src/platform/endpoint/node/responsesApi.ts)

[https://raw.githubusercontent.com/microsoft/vscode/main/extensions/copilot/src/platform/endpoint/node/messagesApi.ts](https://raw.githubusercontent.com/microsoft/vscode/main/extensions/copilot/src/platform/endpoint/node/messagesApi.ts)

[https://keys.zrelay.net/api/catalog](https://keys.zrelay.net/api/catalog)
