OpenCode is configured the same way as Claude Code — via the Anthropic variables.
export ANTHROPIC_BASE_URL="https://api.guardrelay.ai"
export ANTHROPIC_API_KEY="$GUARD_API_KEY"$env:ANTHROPIC_BASE_URL = "https://api.guardrelay.ai"
$env:ANTHROPIC_API_KEY = "$GUARD_API_KEY"The ANTHROPIC_* variables point OpenCode at /v1/messages. Composer and Grok accept that surface, client tools included.
export ANTHROPIC_BASE_URL="https://api.guardrelay.ai"
export ANTHROPIC_API_KEY="$GUARD_API_KEY"
# then pick a model in the client, e.g. cursor-grok-4.6-high or composer-2.5$env:ANTHROPIC_BASE_URL = "https://api.guardrelay.ai"
$env:ANTHROPIC_API_KEY = "$GUARD_API_KEY"
# then pick a model in the client, e.g. cursor-grok-4.6-high or composer-2.5For Kimi, configure an OpenAI-compatible provider in OpenCode pointing at https://api.guardrelay.ai/v1 and use one of the four Kimi IDs.
The ANTHROPIC_* variables take OpenCode to the Anthropic Messages protocol. The path below goes through an OpenAI-compatible provider: it is configured with the same two values, an address and a key.
Take an OpenAI-compatible provider. Base URL https://api.guardrelay.ai/v1, exactly with /v1, header Authorization: Bearer gd-…, and one of the four ids in the model field: k3, k3-256k, kimi-for-coding or kimi-for-coding-highspeed.
First make sure the key answers. The command below returns the model text:
curl -X POST 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
}'