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.
- Open the Command Palette with
Ctrl/Cmd + Shift + P. - Choose Preferences: Open User Settings (JSON).
- Make sure you are editing User/Machine settings, not the project's
.vscode/settings.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" }
]
}- File → Open Folder → choose the project.
- 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.
- Open the Claude Code panel → New session → send a message.
To set the model's behavior and role, create an output style in the same folder.
- Create
.claude/output-styles/my-style.md. - A name block on top, then the system prompt itself:
---
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:
- in the panel via the
/output-stylecommand → pickmy-style, or - 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:
{
"outputStyle": "my-style"
}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.
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.
{
"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 settings | Value |
|---|---|
| API Provider | OpenAI-compatible |
| Base URL | https://api.guardrelay.ai/v1 |
| API Key | gd-… from the bot |
| Model | k3, 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:
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
}'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.
{
"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": "CLAUDE_CODE_MAX_CONTEXT_TOKENS", "value": "256000" },
{ "name": "CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS", "value": "1" },
{ "name": "ANTHROPIC_MODEL", "value": "cursor-grok-4.7-high" }
]
}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.
{
"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.
- Install Visual Studio Code and open it.
- Open Extensions (
Ctrl/Cmd + Shift + X), find Claude Code by Anthropic, and select Install. - Use File → Open Folder to open a test folder. Check its path before granting trust.
Get a universal gd-… key from the direct API link in @guardapi and choose an API package. Do not put the key in a project, repository, task prompt, or screenshot. Balance and usage are available in your Guard account.
- Open Command Palette → Preferences: Open User Settings (JSON). Do not use Workspace settings or
.vscode/settings.json. - Merge the fields below into the existing JSON. They set the endpoint and model without storing the key.
- Quit VS Code completely, set
ANTHROPIC_API_KEYin a terminal, and startcode .from that terminal.
{
"claudeCode.disableLoginPrompt": true,
"claudeCode.useTerminal": false,
"claudeCode.environmentVariables": [
{ "name": "ANTHROPIC_BASE_URL", "value": "https://api.guardrelay.ai/glm" },
{ "name": "ANTHROPIC_MODEL", "value": "glm-5.3" }
]
}macOS / Linux: enter the key at the hidden prompt. The variable applies only to this terminal and the client started from it.
{
unset ANTHROPIC_API_KEY
until [ -n "${ANTHROPIC_API_KEY-}" ]; do printf "Guard API key: "; read -r -s ANTHROPIC_API_KEY || break; printf "\n"; done
export ANTHROPIC_API_KEY
code .
}Windows PowerShell: run these commands in the same window that starts the client. Set the key again after opening a new PowerShell window.
$guardKey = Read-Host "Guard API key" -AsSecureString
$env:ANTHROPIC_API_KEY = [System.Net.NetworkCredential]::new("", $guardKey).Password
code .- Open the Claude Code panel → New session.
- Send:
Read README.md and reply with exactly GUARD_GLM_OK. Change nothing. - In the same session, ask for the line without reopening the file. For Flash, change
ANTHROPIC_MODELtoglm-5.3-flashand restart the window.
| Model ID | When to use it |
|---|---|
glm-5.3 | Default model; text and coding tasks. |
glm-5.3-flash | Fast model; at API level it accepts PNG and PDF through all three protocols, and MP4 through Chat Completions only. |
- Text, client-side file and terminal tools, and continuation in the same panel are confirmed.
- The client itself executes file, edit, and terminal tools. This profile does not connect Z.AI tools or MCP automatically.
- This version was checked with text tasks; its attachment button was not checked. Flash capability at API level does not prove that this particular UI can send a file.
- The profile uses Anthropic Messages. The GLM server prompt is off by default for ordinary API access; client setup does not enable it.
- Native TXT, DOCX, and XLSX are outside the confirmed GLM contract. Use PDF for documents, or PNG with
glm-5.3-flashfor images.
| Symptom | What to check |
|---|---|
401 invalid_api_key | The client received the complete active gd-… key; the variable is set in the same process that starts the client. |
404 model_not_found | The model ID is exactly glm-5.3 or glm-5.3-flash; old GLM IDs, aliases, Turbo, and FlashX are unsupported. |
404 or incorrect path | Base URL is https://api.guardrelay.ai/glm. The client appends /v1/messages; do not add it twice. |
400 invalid_request | The documented API format is selected; reasoning, temperature, MCP, or other unconfirmed fields were not copied from an older profile. |
402 insufficient_balance | Check available balance and unfinished reservations in your Guard account. |
| The extension asks for login or cannot see the key | Close every VS Code window and start code . from the terminal where ANTHROPIC_API_KEY is set; check claudeCode.disableLoginPrompt. |
- Install Visual Studio Code and open it.
- Open Extensions (
Ctrl/Cmd + Shift + X), find Claude Code by Anthropic, and select Install. - Use File → Open Folder to open a test folder. Check its path before granting trust.
Get a universal gd-… key from the direct API link in @guardapi and choose an API package. Do not put the key in a project, repository, task prompt, or screenshot. Balance and usage are available in your Guard account.
- Open Command Palette → Preferences: Open User Settings (JSON). Do not use Workspace settings or
.vscode/settings.json. - Merge the fields below into the existing JSON. They set the endpoint and model without storing the key.
- Quit VS Code completely, set
ANTHROPIC_AUTH_TOKENin a terminal, and startcode .from that terminal. WithANTHROPIC_API_KEY, the extension may show a sign-in screen in a clean profile.
{
"claudeCode.disableLoginPrompt": true,
"claudeCode.useTerminal": false,
"claudeCode.environmentVariables": [
{ "name": "ANTHROPIC_BASE_URL", "value": "https://api.guardrelay.ai" },
{ "name": "ANTHROPIC_MODEL", "value": "gemini-4-argon" }
]
}macOS / Linux: enter the key at the hidden prompt. The variable applies only to this terminal and the client started from it.
{
unset ANTHROPIC_AUTH_TOKEN
until [ -n "${ANTHROPIC_AUTH_TOKEN-}" ]; do printf "Guard API key: "; read -r -s ANTHROPIC_AUTH_TOKEN || break; printf "\n"; done
export ANTHROPIC_AUTH_TOKEN
code .
}Windows PowerShell: run these commands in the same window that starts the client. Set the key again after opening a new PowerShell window.
$guardKey = Read-Host "Guard API key" -AsSecureString
$env:ANTHROPIC_AUTH_TOKEN = [System.Net.NetworkCredential]::new("", $guardKey).Password
code .- Open the Claude Code panel → New session.
- Send:
Read README.md and reply with exactly GUARD_GEMINI_OK. Change nothing. - In the same session, ask for the line without reopening the file. For another model, change
ANTHROPIC_MODEL, for example togemini-3.8-flash, and restart the window.
| Model ID | Input and window |
|---|---|
gemini-4-argon | Text, images, PDF; 1,048,576-token window, shared by input and answer. |
gemini-3.8-flash | Text, images, PDF; 1,048,576-token window for input. |
- The extension itself executes file and terminal tools; it sends the session history to Gemini with every request.
- The Guard catalog takes text, images, and PDF as input and returns text. How to send a file or an image depends on the client's interface; this guide does not describe attachments.
- The profile uses Anthropic Messages. The server prompt is a separate setting of the Gemini family: it applies only when the key has the entitlement and the option is on; client setup does not enable it.
| Symptom | What to check |
|---|---|
401 invalid_api_key | The client received the complete active gd-… key; the variable is set in the same process that starts the client. |
404 model_not_found | The model ID is an exact ID from the table above or the short name gemini; other spellings are unsupported. |
404 or incorrect path | Base URL is https://api.guardrelay.ai. The client appends /v1/messages; do not add it twice. |
400 invalid_request | The documented API format is selected; extra settings from an older profile were not copied: reasoning, temperature, MCP, and others. |
402 insufficient_credit | Check available balance and unfinished reservations in your Guard account. |
| The extension asks for login or cannot see the key | Close every VS Code window and start code . from the terminal where ANTHROPIC_AUTH_TOKEN (not ANTHROPIC_API_KEY) is set; check claudeCode.disableLoginPrompt. |
- Install Visual Studio Code and open it.
- Open Extensions (
Ctrl/Cmd + Shift + X), find Claude Code by Anthropic, and select Install. - Use File → Open Folder to open a test folder. Check its path before granting trust.
Get a universal gd-… key from the direct API link in @guardapi and choose an API package. Do not put the key in a project, repository, task prompt, or screenshot. Balance and usage are available in your Guard account.
- Open Command Palette → Preferences: Open User Settings (JSON). Do not use Workspace settings or
.vscode/settings.json. - Merge the fields below into the existing JSON. They set the endpoint and model without storing the key.
- Quit VS Code completely, set
ANTHROPIC_AUTH_TOKENin a terminal, and startcode .from that terminal. WithANTHROPIC_API_KEY, the extension may show a sign-in screen in a clean profile.
{
"claudeCode.disableLoginPrompt": true,
"claudeCode.useTerminal": false,
"claudeCode.environmentVariables": [
{ "name": "ANTHROPIC_BASE_URL", "value": "https://api.guardrelay.ai" },
{ "name": "ANTHROPIC_MODEL", "value": "muse-wonder-1.0" }
]
}macOS / Linux: enter the key at the hidden prompt. The variable applies only to this terminal and the client started from it.
{
unset ANTHROPIC_AUTH_TOKEN
until [ -n "${ANTHROPIC_AUTH_TOKEN-}" ]; do printf "Guard API key: "; read -r -s ANTHROPIC_AUTH_TOKEN || break; printf "\n"; done
export ANTHROPIC_AUTH_TOKEN
code .
}Windows PowerShell: run these commands in the same window that starts the client. Set the key again after opening a new PowerShell window.
$guardKey = Read-Host "Guard API key" -AsSecureString
$env:ANTHROPIC_AUTH_TOKEN = [System.Net.NetworkCredential]::new("", $guardKey).Password
code .- Open the Claude Code panel → New session.
- Send:
Read README.md and reply with exactly GUARD_MUSE_OK. Change nothing. - In the same session, ask for the line without reopening the file. For another model, change
ANTHROPIC_MODEL, for example tomuse-spark-1.3, and restart the window.
| Model ID | Input and window |
|---|---|
muse-wonder-1.0 | Text, images, PDF; 1,048,576-token window. |
muse-spark-1.3 | Text, images, PDF; 1,048,576-token window. |
muse-spark-1.2 | Text, images, PDF; 1,048,576-token window. |
- The extension itself executes file and terminal tools; it sends the session history to Muse with every request.
- The Guard catalog takes text, images, and PDF as input and returns text. How to send a file or an image depends on the client's interface; this guide does not describe attachments.
- The profile uses Anthropic Messages. The server prompt is a separate setting of the Muse family: it applies only when the key has the entitlement and the option is on; client setup does not enable it.
| Symptom | What to check |
|---|---|
401 invalid_api_key | The client received the complete active gd-… key; the variable is set in the same process that starts the client. |
404 model_not_found | The model ID is an exact ID from the table above or the short name muse; other spellings are unsupported. |
404 or incorrect path | Base URL is https://api.guardrelay.ai. The client appends /v1/messages; do not add it twice. |
400 invalid_request | The documented API format is selected; extra settings from an older profile were not copied: reasoning, temperature, MCP, and others. |
402 insufficient_credit | Check available balance and unfinished reservations in your Guard account. |
| The extension asks for login or cannot see the key | Close every VS Code window and start code . from the terminal where ANTHROPIC_AUTH_TOKEN (not ANTHROPIC_API_KEY) is set; check claudeCode.disableLoginPrompt. |
Get a gd-… key from the Guard bot: open the bot, obtain access and copy your key. Usage is charged to your Guard balance, shown in your Guard account. You will enter the full key at the hidden prompt in a later step.
The Codex family includes gpt-6-astra, gpt-6.1-sol, gpt-6-sol, gpt-6-luna, gpt-5.6-sol, gpt-5.6-terra, and gpt-5.6-luna. The primary example selects Astra; you may use any of the seven exact IDs. The table shows values supported by Guard. For Astra, GPT-6.1 Sol, GPT-6 Sol, GPT-5.6 Sol, and GPT-5.6 Terra the Codex client additionally offers the ultra level. It works through Guard: the client itself turns it into a supported level (xhigh or max, depending on the model) and may hand parts of the task to sub-agents, so it uses more tokens. A direct API request with ultra is rejected. GPT-6.1 Sol defaults to low; none and minimal are unsupported. The API supports none for GPT-6 Sol and GPT-6 Luna, although the native dropdown does not show it.
| Model ID | Guard-supported reasoning effort |
|---|---|
gpt-6-astra | low, medium, high, xhigh, max |
gpt-6.1-sol | low, medium, high, xhigh, max |
gpt-6-sol | none, low, medium, high, xhigh, max |
gpt-6-luna | none, low, medium, high, xhigh, max |
gpt-5.6-sol | low, medium, high, xhigh, max |
gpt-5.6-terra | low, medium, high, xhigh, max |
gpt-5.6-luna | low, medium, high, xhigh, max |
- Install Visual Studio Code and open it.
- Open Extensions using the left sidebar or Ctrl+Shift+X (Cmd+Shift+X on macOS). Find Codex by OpenAI. The official link is on the Codex extension page. Click Install.
- Choose File → Open Folder and select your project. If a trust prompt appears, check the folder path.
- Click the Codex icon. If it is missing, open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P) and run Codex: Open Codex Sidebar.
In the Codex panel, choose the gear in the upper right → Codex Settings → Open config.toml. This opens the user file also used by Codex CLI. If that action is unavailable, the Codex CLI guide includes the file path and creation commands.
Add the settings below. Put the first four lines at the top of the file, before the first [section] heading. If model, model_provider, model_reasoning_effort or model_context_window already exist, update their existing lines. Add [model_providers.guard-codex] once, or update its fields if it exists. Save the file.
model = "gpt-6-astra"
model_provider = "guard-codex"
model_reasoning_effort = "medium"
model_context_window = 872000
[model_providers.guard-codex]
name = "GUARD API · Codex"
base_url = "https://api.guardrelay.ai/codex/v1"
env_key = "GUARD_API_KEY"
wire_api = "responses"| Model ID | model_context_window |
|---|---|
gpt-6-astra | 872000 |
gpt-6.1-sol | 872000 |
gpt-6-sol | 872000 |
gpt-6-luna | 872000 |
gpt-5.6-sol | 872000 |
gpt-5.6-terra | 872000 |
gpt-5.6-luna | 872000 |
model_context_window sets the client history budget. The table uses the declared maximum from the latest saved Codex catalog dated September 13, 2026; it is not a guarantee of the API input hard limit. History compaction may start earlier; this setup does not set a per-response output cap.
| Setting | Meaning |
|---|---|
| model | Exact model ID; GPT-5.6 Sol here. |
| model_provider | Provider section name below: guard-codex. |
| model_reasoning_effort | Reasoning effort. This example uses medium; choose only a supported value from the table above. |
| base_url | Guard address for this family. Do not append /responses manually. |
| env_key | Name of the environment variable containing your key, not the key itself. |
| wire_api | Responses |
If you previously used model_catalog_json with a Claude model catalog, remove that setting when switching to the Codex family. The Claude catalog does not contain GPT models. Do not infer a response limit from model_context_window: if the client sends max_output_tokens, Guard accepts and preserves it, but managed Codex does not guarantee hard truncation; billing follows actual tokens and the key's money rules.
macOS / Linux: run these commands, paste your key at the Guard API key prompt, and press Enter. Input is hidden and is not stored as part of a shell command in history. The variable applies to that terminal and programs launched from it.
unset GUARD_API_KEY; until [ -n "${GUARD_API_KEY-}" ]; do printf "Guard API key: "; read -r -s GUARD_API_KEY || break; printf "\n"; done; export GUARD_API_KEYWindows / PowerShell: run these commands in the window you will use to start the client; paste the key into the hidden prompt and press Enter. Set the variable again when opening a new terminal.
$guardKey = Read-Host "Guard API key" -AsSecureString
$env:GUARD_API_KEY = [System.Net.NetworkCredential]::new("", $guardKey).PasswordFully quit VS Code: Cmd+Q on macOS, or File → Exit on Windows. In the terminal where GUARD_API_KEY is set, run code followed by your project path. Opening a window in an already running VS Code process may retain the old environment without your key.
code .The dot means your terminal’s current folder. If code is not found on macOS, run Shell Command: Install code command in PATH from the VS Code Command Palette. On Windows, check the installer’s Add to PATH option and reopen PowerShell, then set your key variable again.
- Open the Codex panel and start a new task. Check gpt-6-astra in the panel and model_provider = "guard-codex" in config.toml.
- Ask: “Read the project file list and briefly explain its structure.” Wait for the answer and assess any access or command approval by the action shown.
- In the same conversation, ask for more detail about one file. For a persistent model change, update model and a supported reasoning effort in config.toml, then start a new task.
For Codex models, use only the Claude Code extension native addon profile. Store only the settings below in User/Machine settings. Before launching VS Code, provide ANTHROPIC_API_KEY with the same hidden runtime method described above for the key, set the process environment to ANTHROPIC_BASE_URL=https://api.guardrelay.ai/codex, ANTHROPIC_MODEL=gpt-6-astra, DISABLE_PROMPT_CACHING=1, and CLAUDE_CODE_DISABLE_THINKING=1, then launch VS Code from that environment. Do not store the key, base, or model in settings or command history; ANTHROPIC_AUTH_TOKEN is not used here. SIMPLE/SAFE exposes Bash, Edit, and Read; it disables custom skills, plugins, hooks, MCP, custom agents, memory, LSP, and automatic CLAUDE.md loading. The context meter may show NaN%. Ordinary native and terminal modes are not claimed for Codex.
{
"claudeCode.disableLoginPrompt": true,
"claudeCode.useTerminal": false,
"claudeCode.environmentVariables": [
{ "name": "CLAUDE_CODE_SIMPLE", "value": "1" },
{ "name": "CLAUDE_CODE_SAFE_MODE", "value": "1" }
]
}| What you see | What to check |
|---|---|
| GUARD_API_KEY / missing environment variable | The process did not receive the key. Close the client and launch it from the terminal where you set the variable. |
| 401 / invalid_api_key | The variable contains your full actual gd-key rather than a placeholder; the key is active in your Guard account. |
| model_not_found | The ID exactly matches the model list. Remove the old Claude catalog and check the /codex/v1 address. |
| TOML / duplicate key | No duplicated settings or sections. Top-level options appear before [model_providers.guard-codex]. |
| insufficient_balance | Your Guard account has available balance. |
If the error repeats, send Guard support the client name and version, model, error text and request time. Do not send your key or entire configuration file.