onlinellm-claw
v1.0.1
Published
OpenClaw plugin — routes all LLM calls through OpenRouter (supports Grok, Claude, Gemini, GPT, DeepSeek, etc.)
Maintainers
Readme
openclaw-plugin-openrouter
OpenClaw plugin that registers OpenRouter as a model provider, giving you access to 300+ LLMs (Grok, Claude, Gemini, GPT, DeepSeek, …) through a single API key.
Install
openclaw plugins install openclaw-plugin-openrouterThen add your API key:
openclaw onboard --auth-choice openrouter-api-keyOr set the environment variable:
export OPENROUTER_API_KEY=sk-or-...Usage
After installation, every openrouter/<model-id> is available in /model:
/model openrouter/x-ai/grok-4.1-fast:online
/model openrouter/anthropic/claude-sonnet-4-5
/model openrouter/google/gemini-2.5-pro-preview
/model openrouter/openai/gpt-4.1
/model openrouter/deepseek/deepseek-r2Plugin Config (openclaw.json)
{
"plugins": {
"entries": {
"openclaw-plugin-openrouter": {
"enabled": true,
"config": {
// Auto-redirect ALL LLM calls to OpenRouter (replaces built-in LLM):
"autoRoute": true,
"model": "x-ai/grok-4.1-fast:online",
// Inline API key (prefer using onboarding wizard instead):
// "apiKey": "sk-or-...",
// Add extra OpenRouter model ids beyond the built-in catalog:
// "extraModels": ["meta-llama/llama-4-maverick", "cohere/command-r-plus"]
}
}
}
}
}autoRoute
When autoRoute: true, the plugin intercepts every agent LLM call via the before_model_resolve hook and redirects it to the OpenRouter provider using the model you specify in model. This effectively replaces OpenClaw's built-in LLM backend without changing per-agent model settings.
Built-in Model Catalog
| Model ID | Name |
|---|---|
| x-ai/grok-4.1-fast:online | Grok 4.1 Fast (online, web search) |
| x-ai/grok-4.1 | Grok 4.1 |
| x-ai/grok-3 | Grok 3 |
| anthropic/claude-sonnet-4-5 | Claude Sonnet 4.5 |
| anthropic/claude-opus-4-5 | Claude Opus 4.5 |
| google/gemini-2.5-pro-preview | Gemini 2.5 Pro Preview |
| google/gemini-2.5-flash-preview | Gemini 2.5 Flash Preview |
| openai/gpt-4.1 | GPT-4.1 |
| openai/o4-mini | o4-mini (reasoning) |
| deepseek/deepseek-r2 | DeepSeek R2 (reasoning) |
| deepseek/deepseek-chat-v3-5 | DeepSeek Chat V3.5 |
Add more via extraModels in plugin config.
API Key Resolution Order
- Plugin config field
apiKey(not recommended for security) - Auth profile
openrouter:default(set viaopenclaw onboard) - Environment variable
OPENROUTER_API_KEY
Publish to npm
npm publish --access publicThen anyone can install with:
openclaw plugins install openclaw-plugin-openrouter