Skip to content
Getting startedAuthentication

Authentication

The authorization format for the selected family.

Model protocol
HeaderFormatWhere
x-api-keyx-api-key: gd-...Anthropic SDK, Claude Code, /v1/messages
AuthorizationAuthorization: Bearer gd-...OpenAI SDK, Codex, Claude Chat Completions / Responses

For Claude, use the one header expected by your SDK or client.

Two headers, one key
Anthropic SDK / Claude Code
x-api-key: gd-…
OpenAI SDK / Codex
Authorization: Bearer gd-…
One key
gd-…
One balance
ActiveRequest
Revoked
401
Anthropic SDK and Claude Code send x-api-key. OpenAI SDK, Codex and Kimi Chat Completions use Authorization: Bearer. The key and balance are shared; a revoked key returns 401.

Claude example

bash
curl https://api.guardrelay.ai/v1/messages \
  -H "x-api-key: $GUARD_API_KEY" \
  -H "anthropic-version: 2023-06-01" ...
HeaderFormatWhere
AuthorizationAuthorization: Bearer gd-...Kimi POST /v1/chat/completions

For Kimi, pass the universal gd-… key as a Bearer token.

Kimi example

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

Composer and Grok take the same gd-… key. The header follows the client: Anthropic clients send x-api-key, OpenAI-compatible ones send Authorization: Bearer. Both headers reach the same key and the same balance.

Grok example

bash
curl https://api.guardrelay.ai/v1/chat/completions \
  -H "Authorization: Bearer $GUARD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"cursor-grok-4.6-low","messages":[{"role":"user","content":"Hello!"}],"max_tokens":128}'

Composer example

bash
curl https://api.guardrelay.ai/v1/chat/completions \
  -H "Authorization: Bearer $GUARD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"composer-2.5","messages":[{"role":"user","content":"Hello!"}],"max_tokens":128}'

Rotation

In the bot you can keep several active keys and revoke any of them individually. A revoked key returns 401 immediately.

Documentation sections

On this page