1. Create an identity
Create a SafetyRouter API key for this agent or employee. Use tags such as FinanceProjectOne to connect its audit activity to a project.
2. Protect the key
export SAFETYROUTER_API_KEY='sr_live_...'3. Add a custom provider
Add this fragment to your OpenClaw configuration. Use the exact upstream model name allowed by your SafetyRouter tenant.
{
models: {
mode: "merge",
providers: {
safetyrouter: {
baseUrl: "https://your-company.safetyrouter.io/v1",
apiKey: "${SAFETYROUTER_API_KEY}",
api: "openai-completions",
models: [{
id: "provider/model-name",
name: "Model via SafetyRouter",
reasoning: false,
input: ["text"],
contextWindow: 128000,
maxTokens: 8192
}]
}
}
},
agents: {
defaults: {
model: { primary: "safetyrouter/provider/model-name" }
}
}
}Replace the hosted URL with http://192.168.166.105:8000/v1. Only expose that port to trusted network segments and keep a real SafetyRouter key configured.
Select openai-completions. SafetyRouter's Responses endpoint is designed and tested for Codex; OpenClaw's documented Chat Completions adapter remains its supported route here.
Configuration fields verified against the official OpenClaw custom-provider documentation.