Skip to content
Connect a clientClaude Code

Claude Code

Anthropic's CLI via Guard. No login at anthropic.com.

Set up with your own AI
Model protocol

Claude, Kimi, Composer and Grok

Claude Code is Anthropic's terminal CLI. On Guard it works with a gd-… key: no Claude Pro and no OAuth at anthropic.com.

Windows · PowerShell

  1. npm i -g @anthropic-ai/claude-code (Node.js required).
  2. Set the variables:
  3. Run regular claude.
  4. On first launch, approve the API key with Yes / Approve.
powershell
$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
claude

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. 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.

Mac · 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.

sh
{
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
}

Kimi, Composer and Grok in Claude Code

Claude Code calls /v1/messages and sends its own toolset in the tools field. All three families serve that surface and accept that field.

FamilyClaude CodeWhy
Kimiworksboth 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, Grokby exact idUse 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.

Running Claude Code on Kimi

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:

Environment variables
bash · macOS / Linux
export ANTHROPIC_BASE_URL="https://api.guardrelay.ai"
export ANTHROPIC_AUTH_TOKEN="gd-your-key-from-bot"

claude --model k3
PowerShell · Windows
$env:ANTHROPIC_BASE_URL = "https://api.guardrelay.ai"
$env:ANTHROPIC_AUTH_TOKEN = "gd-your-key-from-bot"

claude --model k3

Windows PowerShell:

powershell
$env:ANTHROPIC_BASE_URL = "https://api.guardrelay.ai"
$env:ANTHROPIC_AUTH_TOKEN = "gd-your-key-from-bot"
claude --model k3

If 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:

bash
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 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

Running Claude Code on Grok

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.

Environment variables
bash · macOS / Linux
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
PowerShell · Windows
$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-high

Windows PowerShell:

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-high

Running Claude Code on Composer

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.

Environment variables
bash · macOS / Linux
export ANTHROPIC_BASE_URL="https://api.guardrelay.ai"
export ANTHROPIC_AUTH_TOKEN="gd-your-key-from-bot"

claude --model composer-2.5
PowerShell · Windows
$env:ANTHROPIC_BASE_URL = "https://api.guardrelay.ai"
$env:ANTHROPIC_AUTH_TOKEN = "gd-your-key-from-bot"

claude --model composer-2.5

Windows PowerShell:

powershell
$env:ANTHROPIC_BASE_URL = "https://api.guardrelay.ai"
$env:ANTHROPIC_AUTH_TOKEN = "gd-your-key-from-bot"
claude --model composer-2.5

GLM 5.3 in Claude Code

Install the CLI

Node.js is required. Install Claude Code from the official npm package and check the version.

bash
npm install -g @anthropic-ai/claude-code
claude --version

Get a Guard key

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.

Start a separate GLM profile

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:

sh
{
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:

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

Quick check and continuation

  1. Open an empty test folder and create README.md containing GUARD_GLM_OK.
  2. In Claude Code, send: Read README.md and reply with exactly GUARD_GLM_OK. Change nothing.
  3. In the same session, send: Without opening the file again, what word was in README.md? Expect GUARD_GLM_OK.
  4. To start Flash, exit the client and run claude --model glm-5.3-flash in the same environment.

Models and confirmed capabilities

Model IDWhen to use it
glm-5.3Default model; text and coding tasks.
glm-5.3-flashFast 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-flash for images.

If the connection fails

SymptomWhat to check
401 invalid_api_keyThe client received the complete active gd-… key; the variable is set in the same process that starts the client.
404 model_not_foundThe model ID is exactly glm-5.3 or glm-5.3-flash; old GLM IDs, aliases, Turbo, and FlashX are unsupported.
404 or incorrect pathBase URL is https://api.guardrelay.ai/glm. The client appends /v1/messages; do not add it twice.
400 invalid_requestThe documented API format is selected; reasoning, temperature, MCP, or other unconfirmed fields were not copied from an older profile.
402 insufficient_balanceCheck available balance and unfinished reservations in your Guard account.
Anthropic login appearsCheck CLAUDE_CONFIG_DIR, ANTHROPIC_API_KEY, and ANTHROPIC_BASE_URL; remove a conflicting ANTHROPIC_AUTH_TOKEN from the current process before launch.

Gemini in Claude Code

Install the CLI

Node.js is required. Install Claude Code from the official npm package and check the version.

bash
npm install -g @anthropic-ai/claude-code
claude --version

Get a Guard key

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.

Start a separate Gemini profile

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:

sh
{
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:

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

Quick check and continuation

  1. Open an empty test folder and create README.md containing GUARD_GEMINI_OK.
  2. In Claude Code, send: Read README.md and reply with exactly GUARD_GEMINI_OK. Change nothing.
  3. In the same session, send: Without opening the file again, what word was in README.md? Expect GUARD_GEMINI_OK.
  4. To use another model, exit the client and run, for example, claude --model gemini-3.8-flash in the same environment.

Gemini models and capabilities

Model IDInput and window
gemini-4-argonText, images, PDF; 1,048,576-token window, shared by input and answer.
gemini-3.8-flashText, 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.

If the connection fails

SymptomWhat to check
401 invalid_api_keyThe client received the complete active gd-… key; the variable is set in the same process that starts the client.
404 model_not_foundThe model ID is an exact ID from the table above or the short name gemini; other spellings are unsupported.
404 or incorrect pathBase URL is https://api.guardrelay.ai. The client appends /v1/messages; do not add it twice.
400 invalid_requestThe documented API format is selected; extra settings from an older profile were not copied: reasoning, temperature, MCP, and others.
402 insufficient_creditCheck available balance and unfinished reservations in your Guard account.
Anthropic login appearsCheck CLAUDE_CONFIG_DIR, ANTHROPIC_API_KEY, and ANTHROPIC_BASE_URL; remove a conflicting ANTHROPIC_AUTH_TOKEN from the current process before launch.

Muse in Claude Code

Install the CLI

Node.js is required. Install Claude Code from the official npm package and check the version.

bash
npm install -g @anthropic-ai/claude-code
claude --version

Get a Guard key

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.

Start a separate Muse profile

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:

sh
{
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:

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

Quick check and continuation

  1. Open an empty test folder and create README.md containing GUARD_MUSE_OK.
  2. In Claude Code, send: Read README.md and reply with exactly GUARD_MUSE_OK. Change nothing.
  3. In the same session, send: Without opening the file again, what word was in README.md? Expect GUARD_MUSE_OK.
  4. To use another model, exit the client and run, for example, claude --model muse-spark-1.3 in the same environment.

Muse models and capabilities

Model IDInput and window
muse-wonder-1.0Text, images, PDF; 1,048,576-token window.
muse-spark-1.3Text, images, PDF; 1,048,576-token window.
muse-spark-1.2Text, 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.

If the connection fails

SymptomWhat to check
401 invalid_api_keyThe client received the complete active gd-… key; the variable is set in the same process that starts the client.
404 model_not_foundThe model ID is an exact ID from the table above or the short name muse; other spellings are unsupported.
404 or incorrect pathBase URL is https://api.guardrelay.ai. The client appends /v1/messages; do not add it twice.
400 invalid_requestThe documented API format is selected; extra settings from an older profile were not copied: reasoning, temperature, MCP, and others.
402 insufficient_creditCheck available balance and unfinished reservations in your Guard account.
Anthropic login appearsCheck CLAUDE_CONFIG_DIR, ANTHROPIC_API_KEY, and ANTHROPIC_BASE_URL; remove a conflicting ANTHROPIC_AUTH_TOKEN from the current process before launch.

Codex in Claude Code: separate profile

  1. Set ANTHROPIC_BASE_URL=https://api.guardrelay.ai/codex so Claude Code sends requests to /codex/v1/messages.
  2. Pass the key through ANTHROPIC_AUTH_TOKEN, set DISABLE_PROMPT_CACHING=1 and CLAUDE_CODE_DISABLE_THINKING=1, then select the primary gpt-6-astra example. 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, and gpt-5.6-luna.
  3. Run claude --model gpt-6-astra in 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.
Environment variables
bash · macOS / Linux
{
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
}
PowerShell · Windows
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

Sections

On this page