Claude Code is Anthropic's terminal CLI. On Guard it works with a gd-… key: no Claude Pro and no OAuth at anthropic.com.
npm i -g @anthropic-ai/claude-code(Node.js required).- Set the variables:
- Run regular
claude. - On first launch, approve the API key with Yes / Approve.
$env:ANTHROPIC_BASE_URL = "https://api.guardrelay.ai"
$guardKey = Read-Host "Guard API key" -AsSecureString
$env:ANTHROPIC_AUTH_TOKEN = [System.Net.NetworkCredential]::new("", $guardKey).Password
claudeRun 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. To avoid typing the commands every time, save them in start-claude-guard.ps1: it asks for the key at a hidden prompt when it starts.
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.
{
export ANTHROPIC_BASE_URL="https://api.guardrelay.ai"
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
claude
}Claude Code calls /v1/messages and sends its own toolset in the tools field. All three families serve that surface and accept that field.
| Family | Claude Code | Why |
|---|---|---|
| Kimi | works | both the /v1/messages surface and the tools field are accepted; Claude Code runs the tools itself. The model is named by its exact Kimi id at launch |
| Composer, Grok | by exact id | Use an exact id and the settings below; typed Anthropic tools — computer use, text editor and web search — are unavailable |
Kimi runs in Claude Code itself, and equally in clients that speak plain Chat Completions: Cline, Roo Code, n8n, Python SDK, Node SDK. 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.
It is the same CLI, installed and configured the same way: npm i -g @anthropic-ai/claude-code, then the Guard address and the key in environment variables. Only the model differs: name it by its exact id at launch. Mac / Linux:
export ANTHROPIC_BASE_URL="https://api.guardrelay.ai"
export ANTHROPIC_AUTH_TOKEN="gd-your-key-from-bot"
claude --model k3$env:ANTHROPIC_BASE_URL = "https://api.guardrelay.ai"
$env:ANTHROPIC_AUTH_TOKEN = "gd-your-key-from-bot"
claude --model k3Windows PowerShell:
$env:ANTHROPIC_BASE_URL = "https://api.guardrelay.ai"
$env:ANTHROPIC_AUTH_TOKEN = "gd-your-key-from-bot"
claude --model k3If an editor agent or your own code suits you better, the gd-… key works there as well. You can check it right in the terminal:
curl -X POST https://api.guardrelay.ai/v1/chat/completions \
-H "Authorization: Bearer gd-your-key-from-bot" \
-H "Content-Type: application/json" \
-d '{
"model": "k3",
"messages": [{"role": "user", "content": "Hello!"}],
"max_tokens": 128
}'For work inside an editor, take an agent that speaks plain Chat Completions: Cline or Roo Code. In their settings pick a provider with an OpenAI-compatible API and fill the fields like this: 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 |
The same CLI is installed and configured the same way: npm i -g @anthropic-ai/claude-code, then the Guard address and the key in environment variables. Only the model differs: you pass its exact id at launch.
export ANTHROPIC_BASE_URL="https://api.guardrelay.ai"
export ANTHROPIC_AUTH_TOKEN="gd-your-key-from-bot"
export CLAUDE_CODE_MAX_CONTEXT_TOKENS=256000
export CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1
claude --model cursor-grok-4.7-high$env:ANTHROPIC_BASE_URL = "https://api.guardrelay.ai"
$env:ANTHROPIC_AUTH_TOKEN = "gd-your-key-from-bot"
$env:CLAUDE_CODE_MAX_CONTEXT_TOKENS = "256000"
$env:CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS = "1"
claude --model cursor-grok-4.7-highWindows PowerShell:
$env:ANTHROPIC_BASE_URL = "https://api.guardrelay.ai"
$env:ANTHROPIC_AUTH_TOKEN = "gd-your-key-from-bot"
$env:CLAUDE_CODE_MAX_CONTEXT_TOKENS = "256000"
$env:CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS = "1"
claude --model cursor-grok-4.7-highThe same CLI is installed and configured the same way: npm i -g @anthropic-ai/claude-code, then the Guard address and the key in environment variables. Only the model differs: you pass its exact id at launch.
export ANTHROPIC_BASE_URL="https://api.guardrelay.ai"
export ANTHROPIC_AUTH_TOKEN="gd-your-key-from-bot"
claude --model composer-2.5$env:ANTHROPIC_BASE_URL = "https://api.guardrelay.ai"
$env:ANTHROPIC_AUTH_TOKEN = "gd-your-key-from-bot"
claude --model composer-2.5Windows PowerShell:
$env:ANTHROPIC_BASE_URL = "https://api.guardrelay.ai"
$env:ANTHROPIC_AUTH_TOKEN = "gd-your-key-from-bot"
claude --model composer-2.5Node.js is required. Install Claude Code from the official npm package and check the version.
npm install -g @anthropic-ai/claude-code
claude --versionGet 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.
CLAUDE_CONFIG_DIR keeps this launch separate from your personal Claude Code profile. The client appends /v1/messages itself, so ANTHROPIC_BASE_URL ends in /glm. If the shell already has ANTHROPIC_AUTH_TOKEN, remove it only from the current process because this profile uses ANTHROPIC_API_KEY.
macOS / Linux:
{
export CLAUDE_CONFIG_DIR="$HOME/.claude-guard-glm"
mkdir -p "$CLAUDE_CONFIG_DIR"
unset ANTHROPIC_AUTH_TOKEN
export ANTHROPIC_BASE_URL="https://api.guardrelay.ai/glm"
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
claude --model glm-5.3
}Windows PowerShell:
$env:CLAUDE_CONFIG_DIR = Join-Path $env:USERPROFILE ".claude-guard-glm"
New-Item -ItemType Directory -Force $env:CLAUDE_CONFIG_DIR | Out-Null
Remove-Item Env:ANTHROPIC_AUTH_TOKEN -ErrorAction SilentlyContinue
$env:ANTHROPIC_BASE_URL = "https://api.guardrelay.ai/glm"
$guardKey = Read-Host "Guard API key" -AsSecureString
$env:ANTHROPIC_API_KEY = [System.Net.NetworkCredential]::new("", $guardKey).Password
claude --model glm-5.3- Open an empty test folder and create
README.mdcontainingGUARD_GLM_OK. - In Claude Code, send:
Read README.md and reply with exactly GUARD_GLM_OK. Change nothing. - In the same session, send:
Without opening the file again, what word was in README.md?ExpectGUARD_GLM_OK. - To start Flash, exit the client and run
claude --model glm-5.3-flashin the same environment.
| 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 Read/Edit/Bash, and same-session continuation 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. |
| Anthropic login appears | Check CLAUDE_CONFIG_DIR, ANTHROPIC_API_KEY, and ANTHROPIC_BASE_URL; remove a conflicting ANTHROPIC_AUTH_TOKEN from the current process before launch. |
Node.js is required. Install Claude Code from the official npm package and check the version.
npm install -g @anthropic-ai/claude-code
claude --versionGet 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.
CLAUDE_CONFIG_DIR keeps this launch separate from your personal Claude Code profile. The client appends /v1/messages itself, so ANTHROPIC_BASE_URL is https://api.guardrelay.ai without /v1. If the shell already has ANTHROPIC_AUTH_TOKEN, remove it only from the current process because this profile uses ANTHROPIC_API_KEY. On the first launch Claude Code may ask whether to use the key from ANTHROPIC_API_KEY: answer Yes.
macOS / Linux:
{
export CLAUDE_CONFIG_DIR="$HOME/.claude-guard-gemini"
mkdir -p "$CLAUDE_CONFIG_DIR"
unset ANTHROPIC_AUTH_TOKEN
export ANTHROPIC_BASE_URL="https://api.guardrelay.ai"
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
claude --model gemini-4-argon
}Windows PowerShell:
$env:CLAUDE_CONFIG_DIR = Join-Path $env:USERPROFILE ".claude-guard-gemini"
New-Item -ItemType Directory -Force $env:CLAUDE_CONFIG_DIR | Out-Null
Remove-Item Env:ANTHROPIC_AUTH_TOKEN -ErrorAction SilentlyContinue
$env:ANTHROPIC_BASE_URL = "https://api.guardrelay.ai"
$guardKey = Read-Host "Guard API key" -AsSecureString
$env:ANTHROPIC_API_KEY = [System.Net.NetworkCredential]::new("", $guardKey).Password
claude --model gemini-4-argon- Open an empty test folder and create
README.mdcontainingGUARD_GEMINI_OK. - In Claude Code, send:
Read README.md and reply with exactly GUARD_GEMINI_OK. Change nothing. - In the same session, send:
Without opening the file again, what word was in README.md?ExpectGUARD_GEMINI_OK. - To use another model, exit the client and run, for example,
claude --model gemini-3.8-flashin the same environment.
| 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. |
- Claude Code itself executes the read, edit, 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. |
| Anthropic login appears | Check CLAUDE_CONFIG_DIR, ANTHROPIC_API_KEY, and ANTHROPIC_BASE_URL; remove a conflicting ANTHROPIC_AUTH_TOKEN from the current process before launch. |
Node.js is required. Install Claude Code from the official npm package and check the version.
npm install -g @anthropic-ai/claude-code
claude --versionGet 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.
CLAUDE_CONFIG_DIR keeps this launch separate from your personal Claude Code profile. The client appends /v1/messages itself, so ANTHROPIC_BASE_URL is https://api.guardrelay.ai without /v1. If the shell already has ANTHROPIC_AUTH_TOKEN, remove it only from the current process because this profile uses ANTHROPIC_API_KEY. On the first launch Claude Code may ask whether to use the key from ANTHROPIC_API_KEY: answer Yes.
macOS / Linux:
{
export CLAUDE_CONFIG_DIR="$HOME/.claude-guard-muse"
mkdir -p "$CLAUDE_CONFIG_DIR"
unset ANTHROPIC_AUTH_TOKEN
export ANTHROPIC_BASE_URL="https://api.guardrelay.ai"
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
claude --model muse-wonder-1.0
}Windows PowerShell:
$env:CLAUDE_CONFIG_DIR = Join-Path $env:USERPROFILE ".claude-guard-muse"
New-Item -ItemType Directory -Force $env:CLAUDE_CONFIG_DIR | Out-Null
Remove-Item Env:ANTHROPIC_AUTH_TOKEN -ErrorAction SilentlyContinue
$env:ANTHROPIC_BASE_URL = "https://api.guardrelay.ai"
$guardKey = Read-Host "Guard API key" -AsSecureString
$env:ANTHROPIC_API_KEY = [System.Net.NetworkCredential]::new("", $guardKey).Password
claude --model muse-wonder-1.0- Open an empty test folder and create
README.mdcontainingGUARD_MUSE_OK. - In Claude Code, send:
Read README.md and reply with exactly GUARD_MUSE_OK. Change nothing. - In the same session, send:
Without opening the file again, what word was in README.md?ExpectGUARD_MUSE_OK. - To use another model, exit the client and run, for example,
claude --model muse-spark-1.3in the same environment.
| 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. |
- Claude Code itself executes the read, edit, 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. |
| Anthropic login appears | Check CLAUDE_CONFIG_DIR, ANTHROPIC_API_KEY, and ANTHROPIC_BASE_URL; remove a conflicting ANTHROPIC_AUTH_TOKEN from the current process before launch. |
- Set
ANTHROPIC_BASE_URL=https://api.guardrelay.ai/codexso Claude Code sends requests to/codex/v1/messages. - Pass the key through
ANTHROPIC_AUTH_TOKEN, setDISABLE_PROMPT_CACHING=1andCLAUDE_CODE_DISABLE_THINKING=1, then select the primarygpt-6-astraexample. Seven exact IDs are available:gpt-6-astra,gpt-6.1-sol,gpt-6-sol,gpt-6-luna,gpt-5.6-sol,gpt-5.6-terra, andgpt-5.6-luna. - Run
claude --model gpt-6-astrain a separate test folder without personal data: 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.
{
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 ANTHROPIC_BASE_URL="https://api.guardrelay.ai/codex"
export ANTHROPIC_AUTH_TOKEN="$GUARD_API_KEY"
export DISABLE_PROMPT_CACHING=1
export CLAUDE_CODE_DISABLE_THINKING=1
claude --model gpt-6-astra
}do {
$guardKey = Read-Host "Guard API key" -AsSecureString
$env:ANTHROPIC_AUTH_TOKEN = [System.Net.NetworkCredential]::new("", $guardKey).Password
} until ($env:ANTHROPIC_AUTH_TOKEN)
$env:ANTHROPIC_BASE_URL = "https://api.guardrelay.ai/codex"
$env:DISABLE_PROMPT_CACHING = "1"
$env:CLAUDE_CODE_DISABLE_THINKING = "1"
claude --model gpt-6-astra