Skip to content
Connect a clientVS Code

VS Code

new

Claude Code extension via machine-scoped settings, with no key in the project.

Set up with your own AI
Model protocol

You do not need to put the key in a repository or .claude/settings.local.json. The current extension supports machine-scoped claudeCode.environmentVariables and claudeCode.disableLoginPrompt; the configuration stays on this computer and applies to opened projects.

1. Open User Settings JSON

  1. Open the Command Palette with Ctrl/Cmd + Shift + P.
  2. Choose Preferences: Open User Settings (JSON).
  3. Make sure you are editing User/Machine settings, not the project's .vscode/settings.json.

2. Add Guard

json
{
  "claudeCode.disableLoginPrompt": true,
  "claudeCode.environmentVariables": [
    { "name": "ANTHROPIC_BASE_URL", "value": "https://api.guardrelay.ai" },
    { "name": "ANTHROPIC_AUTH_TOKEN", "value": "gd-your-key-from-the-bot" }
  ]
}

3. Open the project and trust it

  1. File → Open Folder → choose the project.
  2. Click Trust in the bottom-left (or Trust the authors in the dialog) — otherwise, in Restricted Mode, the Claude Code extension won't start and the panel won't appear.
  3. Open the Claude Code panel → New session → send a message.

System prompt (output style)

To set the model's behavior and role, create an output style in the same folder.

  1. Create .claude/output-styles/my-style.md.
  2. A name block on top, then the system prompt itself:
markdown
---
name: my-style
description: My system prompt
---
You are the Guard assistant. Answer concisely.
Always add tests to new code.

Activate it in one of two ways:

  1. in the panel via the /output-style command → pick my-style, or
  2. add only the non-secret "outputStyle": "my-style" to the project's .claude/settings.local.json — then the style turns on automatically when the folder opens:
json
{
  "outputStyle": "my-style"
}

Kimi, Composer and Grok in the panel

The panel is the same Claude Code extension, so the families are the same too: Kimi, Composer and Grok all work on /v1/messages, tools included. The panel takes its model from ANTHROPIC_MODEL, as it has no command-line flag. Full breakdown on the Claude Code page.

For those families inside the same VS Code, use Cline or Roo Code with an OpenAI-compatible provider. In Cline, kimi-for-coding and kimi-for-coding-highspeed may return 403 kimi_agent_not_allowed: use a supported client such as Roo Code or Kilo Code. Do not remove or impersonate the agent name in the system prompt to bypass this restriction.

Kimi in the Claude Code panel

The panel is the same Claude Code extension, so the settings are the same: the Guard address and the key in machine-scoped claudeCode.environmentVariables. The model goes in the same place, as ANTHROPIC_MODEL, because the panel has no command-line flag.

json
{
  "claudeCode.disableLoginPrompt": true,
  "claudeCode.environmentVariables": [
    { "name": "ANTHROPIC_BASE_URL", "value": "https://api.guardrelay.ai" },
    { "name": "ANTHROPIC_AUTH_TOKEN", "value": "gd-your-key-from-bot" },
    { "name": "ANTHROPIC_MODEL", "value": "k3" }
  ]
}

If an OpenAI-compatible provider suits you better, Cline and Roo Code run in the same editor. Their fields are these: In Cline, kimi-for-coding and kimi-for-coding-highspeed may return 403 kimi_agent_not_allowed: use a supported client such as Roo Code or Kilo Code. Do not remove or impersonate the agent name in the system prompt to bypass this restriction.

Field in the agent settingsValue
API ProviderOpenAI-compatible
Base URLhttps://api.guardrelay.ai/v1
API Keygd-… from the bot
Modelk3, k3-256k, kimi-for-coding or kimi-for-coding-highspeed

Your own code in the same editor uses the same address. The key can be checked right in the built-in terminal:

bash
curl -X POST https://api.guardrelay.ai/v1/chat/completions \
  -H "Authorization: Bearer gd-your-key-from-the-bot" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "k3",
    "messages": [{"role": "user", "content": "Hello!"}],
    "max_tokens": 128
  }'

Point the panel at Grok

The panel is the same Claude Code extension, so the settings are the same: the Guard address and the key in machine-scoped claudeCode.environmentVariables. The model goes in the same place, as ANTHROPIC_MODEL, because the panel has no command-line flag.

json
{
  "claudeCode.disableLoginPrompt": true,
  "claudeCode.environmentVariables": [
    { "name": "ANTHROPIC_BASE_URL", "value": "https://api.guardrelay.ai" },
    { "name": "ANTHROPIC_AUTH_TOKEN", "value": "gd-your-key-from-the-bot" },
    { "name": "ANTHROPIC_MODEL", "value": "cursor-grok-4.6-medium" }
  ]
}

Point the panel at Composer

The panel is the same Claude Code extension, so the settings are the same: the Guard address and the key in machine-scoped claudeCode.environmentVariables. The model goes in the same place, as ANTHROPIC_MODEL, because the panel has no command-line flag.

json
{
  "claudeCode.disableLoginPrompt": true,
  "claudeCode.environmentVariables": [
    { "name": "ANTHROPIC_BASE_URL", "value": "https://api.guardrelay.ai" },
    { "name": "ANTHROPIC_AUTH_TOKEN", "value": "gd-your-key-from-the-bot" },
    { "name": "ANTHROPIC_MODEL", "value": "composer-2.5" }
  ]
}

The rest is as usual: File → Open Folder, the Trust button in the bottom-left, then the Claude Code panel → New session. In Restricted Mode the extension does not start and the panel does not appear.

Documentation sections

On this page