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 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"
$env:ANTHROPIC_AUTH_TOKEN = "gd-your-key-from-bot"
claude

To avoid typing it every time — save a start-claude-guard.ps1 and run it.

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
PowerShell · Windows
$env:ANTHROPIC_BASE_URL = "https://api.guardrelay.ai"
$env:ANTHROPIC_AUTH_TOKEN = "gd-your-key-from-bot"
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, Grokworksboth the /v1/messages surface and the tools field are accepted; Claude Code runs the tools itself. Typed Anthropic tools (computer use, text editor, web search) are unavailable — Cursor exposes no such contract

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"

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

claude --model cursor-grok-4.6-medium

Windows PowerShell:

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

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

Documentation sections

On this page