Setup Guide
OpenClaw OpenRouter Setup — Access 300+ AI Models in One API
OpenRouter is a unified API gateway that gives your OpenClaw agent access to 300+ AI models from every major provider — Claude, GPT-5, Gemini, DeepSeek, Llama, Qwen, and more. This guide covers how to create an account, get your API key, configure OpenClaw, and manage costs.
What Is OpenRouter?
OpenRouter is a unified API gateway that provides access to 300+ AI models from all major providers through a single API endpoint. Instead of managing separate API keys and billing accounts for OpenAI, Anthropic, Google, Meta, and dozens of other providers, you use one OpenRouter API key to access them all.
OpenRouter uses pay-per-use pricing with no monthly commitments. You add credits to your account and only pay for what you use. Prices are transparent and often match or undercut the original providers' rates.
Why Use OpenRouter with OpenClaw?
There are several ways to connect AI models to your OpenClaw agent. Here is how OpenRouter compares:
| OpenRouter | Direct API | Ollama (Local) | |
|---|---|---|---|
| Model variety | 300+ models, all providers | One provider per key | Open-weight models only |
| Cost | Pay-per-use, no minimums | Pay-per-use per provider | Free (hardware costs) |
| Setup complexity | One API key for everything | Separate key per provider | Install + download models |
| Model switching | Instant — change one line | New key + config per provider | Download each model (~GB) |
| Cloud / Local | Cloud | Cloud | Local |
| Best for | Most users — flexibility + simplicity | Single-provider power users | Privacy-focused, offline use |
For most OpenClaw users, OpenRouter is the best choice. One API key gives you access to every model, and you can switch between them instantly without changing providers or managing multiple accounts.
Step 1: Create an OpenRouter Account
- Go to openrouter.ai and click “Sign Up”
- Create an account with Google, GitHub, or email
- Navigate to Settings → Credits and add credits to your account (minimum $5)
OpenRouter also offers free models — several open-weight models like Llama and Mistral can be used at no cost, so you can test your setup before adding credits.
Step 2: Get Your API Key
- Go to openrouter.ai/keys
- Click “Create Key”
- Give it a name (e.g., “OpenClaw Agent”)
- Copy the key (starts with
sk-or-) — you won't be able to see it again
Optionally, set a credit limit on the key to prevent unexpected charges. This is especially useful if you're experimenting with expensive models.
Step 3: Configure OpenClaw
Set OpenRouter as the model provider in your openclaw.json configuration:
{
"models": {
"providers": {
"openrouter": {
"apiKey": "sk-or-your-api-key-here"
}
}
},
"agents": {
"defaults": {
"model": {
"primary": "openrouter/anthropic/claude-sonnet-4.6"
}
}
}
}Important: The model ID must be prefixed with openrouter/ followed by the model's identifier on OpenRouter. This tells OpenClaw to route the request through your OpenRouter provider.
Popular Models on OpenRouter
Here are some of the most popular models available through OpenRouter, with approximate pricing per million tokens:
| Model | Provider | Input (per 1M tokens) | Output (per 1M tokens) | Best for |
|---|---|---|---|---|
| Claude Sonnet 4.6 | Anthropic | $3.00 | $15.00 | Coding, analysis, writing |
| GPT-5.3 | OpenAI | $2.50 | $10.00 | General purpose, reasoning |
| Gemini 2.5 Pro | $1.25 | $5.00 | Long context, multimodal | |
| DeepSeek V3 | DeepSeek | $0.27 | $1.10 | Budget-friendly, coding |
| Llama 4 Maverick | Meta | $0.20 | $0.60 | Open-weight, cost-efficient |
| Qwen3 235B | Alibaba | $0.15 | $0.60 | Multilingual, reasoning |
Prices are approximate and may vary. Check openrouter.ai/models for the latest pricing and full model list. You can also browse models on the OpenClaw Launch models page.
Switch Models Instantly
One of the biggest advantages of OpenRouter is instant model switching. To change models, update the primary model in your config:
"agents": {
"defaults": {
"model": {
"primary": "openrouter/google/gemini-2.5-pro"
}
}
}OpenClaw supports hot-reload for model changes — your agent picks up the new model without restarting. This means you can experiment with different models in real time, switching from Claude to GPT to Gemini to DeepSeek in seconds.
Cost Management
OpenRouter provides several tools to keep your spending under control:
- Per-key credit limits — Set a maximum spend on each API key so it automatically stops when the limit is reached
- Usage dashboard — View detailed breakdowns of which models you're using and how much each costs at openrouter.ai/activity
- Free models — Use open-weight models (Llama, Mistral, Qwen) at no cost for testing or low-stakes tasks
- BYOK (Bring Your Own Key) — If you already have an API key from a provider (e.g., OpenAI or Anthropic), you can add it to your OpenRouter account under Settings → Integrations. Requests to that provider route through your own key instead of OpenRouter's credits
To check your remaining credits programmatically:
curl https://openrouter.ai/api/v1/auth/key \
-H "Authorization: Bearer sk-or-your-api-key"Troubleshooting
Authentication Error (401)
If you see an authentication error when your agent tries to use a model:
- Verify your API key starts with
sk-or- - Check for extra spaces or newlines in the key
- Confirm the key is active at openrouter.ai/keys
- Make sure
models.providers.openrouter.apiKeyis set correctly in your config
Model Not Found
If you get a “model not found” error:
- Check the model ID is correct — use the exact ID from openrouter.ai/models
- Remember to prefix with
openrouter/in your OpenClaw config (e.g.,openrouter/anthropic/claude-sonnet-4.6) - Some models may be temporarily unavailable — check OpenRouter's status page
Rate Limits
OpenRouter applies rate limits based on your account tier and the specific model. If you hit rate limits:
- Wait a few seconds and retry — most limits reset quickly
- Add more credits to increase your rate limit tier
- Switch to a less popular model temporarily
Credit Exhaustion
If your agent stops responding, check your credit balance. When credits run out, OpenRouter returns an error instead of model responses. Add more credits at openrouter.ai/credits to resume.
OpenRouter on OpenClaw Launch
On OpenClaw Launch, every managed instance comes with OpenRouter pre-configured. You don't need to create an OpenRouter account or manage API keys — it's handled automatically. Your subscription includes model access, and you can switch between all available models from the models page.
If you prefer to use your own OpenRouter API key, you can enter it in the configurator to use your own credits and access any model available on OpenRouter.
Frequently Asked Questions
Is OpenRouter free?
OpenRouter itself is free to sign up. You pay only for the models you use, with pay-per-use pricing. Several open-weight models (Llama, Mistral, Qwen) are available at no cost. For premium models like Claude and GPT-5, you add credits and pay per token.
Which OpenRouter model is best for OpenClaw?
For most users, Claude Sonnet 4.6 offers the best balance of intelligence, speed, and cost. For budget-conscious use, DeepSeek V3 provides excellent quality at a fraction of the price. For multilingual needs, Qwen3 excels. You can switch models anytime to find the best fit.
Can I use my own API keys with OpenRouter?
Yes. OpenRouter supports BYOK (Bring Your Own Key). Add your provider API keys under Settings → Integrations on openrouter.ai. Requests to those providers will use your own keys, which can be cheaper if you have existing agreements or credits with a provider.
How much does OpenRouter cost?
Costs depend entirely on which models you use and how much. Light personal use with an efficient model like DeepSeek V3 might cost $1–5/month. Heavy use with premium models like Claude or GPT-5 might cost $20–50/month. There are no monthly minimums or commitments — you only pay for what you use.
What's Next?
- Compare AI models — Browse all models available on OpenClaw Launch with pricing and benchmarks
- See pricing — Deploy with OpenRouter pre-configured, starting at $3/month
- Ollama local models — Run AI models locally as an alternative to OpenRouter
- DeepSeek setup — Use DeepSeek models directly or through OpenRouter