Using OpenRouter with OpenClaw
Set up OpenRouter to access 100+ AI models through a single API key with OpenClaw.
What Is OpenRouter?
OpenRouter provides a unified API for accessing 100+ AI models from all major providers. One API key gives you access to Claude, GPT, Gemini, Mistral, Llama, and many more.
Why Use OpenRouter with OpenClaw?
- One key, all models — No need for separate API keys per provider
- Easy switching — Change models in one config line
- Fallback routing — Automatically try another model if one is down
- Usage tracking — Single dashboard for all model usage
- Cost management — Set spending limits across all models
Setup
Step 1: Create an OpenRouter Account
Sign up at openrouter.ai and add credits.
Step 2: Generate an API Key
Go to Keys → Create Key. Copy the key (starts with sk-or-).
Step 3: Configure OpenClaw
{
"provider": "openrouter",
"api_key_env": "OPENROUTER_API_KEY",
"model": "anthropic/claude-sonnet-4-5"
}
Set the environment variable:
export OPENROUTER_API_KEY="sk-or-..."
Popular Models via OpenRouter
| Model | ID | Best For |
|---|---|---|
| Claude Sonnet 4.5 | anthropic/claude-sonnet-4-5 | Coding, analysis |
| Claude Opus 4.6 | anthropic/claude-opus-4-6 | Complex reasoning |
| GPT-5.2 | openai/gpt-5.2 | General tasks |
| Gemini 3 Flash | google/gemini-3-flash | Fast, cheap |
| Mistral Large | mistralai/mistral-large | European languages |
Switching Models
Change the model in your config or via chat:
- "Switch to GPT-5.2"
- "Use Claude Opus for this conversation"
- "What models are available?"
Cost Management
Set Spending Limits
On OpenRouter's dashboard, set daily or monthly spending caps.
Monitor Usage
openclaw usage # Show recent API usage
openclaw usage --cost # Show cost breakdown
Optimize Costs
- Use cheaper models for simple tasks
- Use powerful models only when needed
- Set up model routing to auto-select based on task complexity
Claw for All + OpenRouter
Claw for All uses OpenRouter by default, giving you access to all models through the dashboard. Switch models in your control panel without touching configuration files.
Ready for your AI assistant?
Get started with Claw for All today. No setup, no terminal, just sign up and go.
Get StartedRelated Guides
Using OpenClaw Canvas: Visual Workspace Guide
Create interactive diagrams, dashboards, and visual content with OpenClaw's Canvas feature.
Voice Commands and Talk Mode with OpenClaw
Use voice wake words and hands-free conversation with OpenClaw on macOS, iOS, and Android.
Running Shell Commands Through OpenClaw
Execute terminal commands, scripts, and system operations through natural conversation.