Integrations
OpenClaw
Use Router9 as a custom provider in OpenClaw
OpenClaw is a powerful AI agent framework for Node.js that supports 40+ LLM providers. You can add Router9 as a custom OpenAI-compatible provider.
Setup
Add Router9 as a custom provider in your OpenClaw configuration file:
{
models: {
providers: {
router9: {
baseUrl: "https://api.router9.com/v1",
apiKey: "${ROUTER9_API_KEY}",
api: "openai-completions",
models: [
{
id: "gpt-4o",
name: "GPT-4o via Router9",
contextWindow: 128000,
maxTokens: 16384
},
{
id: "claude-sonnet-4-20250514",
name: "Claude Sonnet via Router9",
contextWindow: 200000,
maxTokens: 8192
}
]
}
}
}
}Set as Default Model
{
agents: {
defaults: {
model: { primary: "router9/gpt-4o" }
}
}
}Environment Variables
Set your Router9 API key:
export ROUTER9_API_KEY=sk-r9k-your-key-hereThe apiKey field in the config references this via "${ROUTER9_API_KEY}".
Using the Anthropic Protocol
If you prefer to use Anthropic-native models through OpenClaw's Anthropic protocol:
{
models: {
providers: {
router9_anthropic: {
baseUrl: "https://api.router9.com/anthropic",
apiKey: "${ROUTER9_API_KEY}",
api: "anthropic-messages",
models: [
{
id: "claude-sonnet-4-20250514",
name: "Claude Sonnet via Router9",
contextWindow: 200000,
maxTokens: 8192
}
]
}
}
}
}CLI Setup
# Set your Router9 key
export ROUTER9_API_KEY=sk-r9k-your-key-here
# Set the default model to Router9
openclaw models set router9/gpt-4oTips
- OpenClaw supports key rotation. You can set multiple Router9 keys via
ROUTER9_API_KEYS(comma-separated) for redundancy. - Model references follow the
provider/modelformat — userouter9/gpt-4o,router9/claude-sonnet-4-20250514, etc. - See the OpenClaw providers docs for advanced options like failover and model metadata.