Skip to content
Getting startedKeys and URL

Keys and URL

What to use, what not to touch.

Model protocol

Guard issues universal gd-… keys. The gateway validates the key, selects the family from the exact model id, and deducts Claude, Kimi, GLM, Gemini, Muse, Composer, Grok, or Codex usage from the key's shared balance.

ParameterValue
Base URLhttps://api.guardrelay.ai
API Keygd-… from @guardapi
Accountapp.guardrelay.ai/
One address, three protocols
Shared key
gd-…
GUARD API
https://api.guardrelay.ai
Anthropic Messages
/v1/messages
Chat Completions
/v1/chat/completions
Responses
/v1/responses
Exact model id
model
Choose the protocol your client expects. The OpenAI SDK Base URL includes /v1; the model field selects the family.

Claude endpoints

For Claude, the gateway supports Anthropic- and OpenAI-compatible formats. Choose the endpoint your client expects.

EndpointFormatWho uses it
/v1/messagesAnthropic MessagesClaude Code, Anthropic SDK, curl
/v1/chat/completionsOpenAI ChatOpenAI SDK, most clients
/v1/responsesOpenAI ResponsesCodex (newer versions)

Codex surfaces

FunctionShared aliasRetained alias
ModelsGET /v1/modelsGET /codex/v1/models
Responses HTTP/SSE/WS/v1/responses/codex/v1/responses
Chat JSON/SSE/v1/chat/completions/codex/v1/chat/completions
Messages JSON/SSE/v1/messages/codex/v1/messages
Codex Filesnot created/codex/v1/files

Kimi surfaces

The key and the address are shared by every family. The gateway picks the family from the exact model id in the model field, so Kimi needs no separate key and no separate address.

What you configureValue for Kimi
OpenAI SDK Base URLhttps://api.guardrelay.ai/v1
HeaderAuthorization: Bearer gd-…
Surfacesall three: plain POST /v1/chat/completions, the Anthropic Messages protocol and the Responses protocol
Modelsk3, k3-256k, kimi-for-coding, kimi-for-coding-highspeed

Check the key

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

Request chain

  1. Key check: limit, validity, revocation.
  2. Route to Claude, Kimi, GLM, Gemini, Muse, Composer, Grok, or Codex from the exact model id.
  3. Deduct tokens from the shared key credit.

Claude Code

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
{
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
}
PowerShell · Windows
$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

Composer and Grok endpoints

These models answer on all three surfaces. The endpoint follows your client, the model follows the model field.

EndpointRequest fields
/v1/messagesmodel, messages, system, max_tokens, stream, tools
/v1/chat/completionsmodel, messages, max_tokens or max_completion_tokens, stream, tools
/v1/responsesmodel, input, instructions, max_output_tokens, stream, tools

Check the key

The key and the address are the same as for Claude: these models need no separate signup and no separate address. The gateway picks the family from the exact id in the model field, and the key keeps one balance for every family.

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

GLM URLs

Use the family Base URL for a dedicated GLM profile. If the application already uses the shared Guard endpoint, changing model to an exact GLM ID is enough.

PurposeBase URL / endpoint
OpenAI SDK / Chat / Responseshttps://api.guardrelay.ai/glm/v1
Anthropic SDK / Messageshttps://api.guardrelay.ai/glm
Shared APIhttps://api.guardrelay.ai/v1
GLM-only catalogGET https://api.guardrelay.ai/glm/v1/models
bash
curl https://api.guardrelay.ai/glm/v1/models \
  -H "Authorization: Bearer $GUARD_API_KEY"

Both Base URLs use the same key and balance. The path changes the namespace, not the rate, model, or response shape.

Sections

On this page