OpenClaw is a local gateway assistant: it installs on your own machine and decides for itself which model provider to call. A third-party address and key are described in its own configuration.
npm install -g openclaw@latest --allow-scripts=openclawSettings live in ~/.openclaw/openclaw.json, JSON5 with comments, and the gateway re-reads the file on its own. Your address goes into the models.providers section: the baseUrl, apiKey and api fields plus a model list. The api field picks the protocol; without it openai-completions is used.
// ~/.openclaw/openclaw.json
{
models: {
mode: "merge",
providers: {
guard: {
baseUrl: "https://api.guardrelay.ai/v1",
apiKey: "${GUARD_API_KEY}",
api: "openai-completions",
models: [{ id: "claude-sonnet-5", name: "Claude Sonnet 5" }],
},
},
},
agents: { defaults: { model: { primary: "guard/claude-sonnet-5" } } },
}// ~/.openclaw/openclaw.json
{
models: {
mode: "merge",
providers: {
guard: {
baseUrl: "https://api.guardrelay.ai/v1",
apiKey: "${GUARD_API_KEY}",
api: "openai-completions",
models: [{ id: "k3", name: "Kimi K3", maxTokens: 8192 }],
},
},
},
agents: { defaults: { model: { primary: "guard/k3" } } },
}// ~/.openclaw/openclaw.json
{
models: {
mode: "merge",
providers: {
guard: {
baseUrl: "https://api.guardrelay.ai/v1",
apiKey: "${GUARD_API_KEY}",
api: "openai-completions",
models: [{ id: "cursor-grok-4.6-medium", name: "Grok 4.6", maxTokens: 8192 }],
},
},
},
agents: { defaults: { model: { primary: "guard/cursor-grok-4.6-medium" } } },
}// ~/.openclaw/openclaw.json
{
models: {
mode: "merge",
providers: {
guard: {
baseUrl: "https://api.guardrelay.ai/v1",
apiKey: "${GUARD_API_KEY}",
api: "openai-completions",
models: [{ id: "composer-2.5", name: "Composer 2.5", maxTokens: 8192 }],
},
},
},
agents: { defaults: { model: { primary: "guard/composer-2.5" } } },
}A model is named as a provider and model pair, so primary carries guard/ plus the exact id. The default can also be changed with openclaw models set guard/<exact id>, and openclaw models list shows what was picked up.
The contextWindow, cost, input and reasoning fields on a model are optional. Without contextWindow the window stays unknown and the client budgets against its own fallback, so it is better to state it. The key can stay as the ${GUARD_API_KEY} substitution: the value is then taken from the environment or from ~/.openclaw/.env.
The same key also works over the Anthropic Messages protocol: put anthropic-messages in api, and then write the address without /v1, because the client appends the version itself. For Guard the variant above is enough.
For Kimi keep openai-completions, and then /v1 in the address is required.