Advanced Features
🔀

Using OpenRouter with OpenClaw

Set up OpenRouter to access 100+ AI models through a single API key with OpenClaw.

4 min read|
openroutermodel accessapi integration

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

ModelIDBest For
Claude Sonnet 4.5anthropic/claude-sonnet-4-5Coding, analysis
Claude Opus 4.6anthropic/claude-opus-4-6Complex reasoning
GPT-5.2openai/gpt-5.2General tasks
Gemini 3 Flashgoogle/gemini-3-flashFast, cheap
Mistral Largemistralai/mistral-largeEuropean 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.

openroutermodel accessapi integrationmulti-modelopenrouter setup

Ready for your AI assistant?

Get started with Claw for All today. No setup, no terminal, just sign up and go.

Get Started

Related Guides