OpenRouter with OpenClaw

One API for 30+ models — Claude, GPT, Gemini, Llama, Mistral

OpenRouter is an aggregation layer: one API key gives you access to dozens of models (Claude, GPT, Gemini, Llama, Mistral, and more) from multiple providers. OpenClaw integrates with OpenRouter so you can switch models or try new ones without managing separate API keys for each provider. Good for experimentation, cost comparison, and failover across vendors.

Why OpenRouter

  • One API key — No need for separate Anthropic, OpenAI, Google keys
  • 30+ models — Claude, GPT, Gemini, Llama, Mistral, and more
  • Failover — Automatic fallback if one model is down
  • Cost comparison — Compare pricing across providers
  • Experiment easily — Try new models without new credentials

Authentication

Create an API key at openrouter.ai. Store in ~/.openclaw/credentials or via openclaw secrets. The same key works for all models on OpenRouter.

Basic Configuration

Use the OpenRouter provider and specify the model ID. Model IDs follow the format provider/model-name (e.g. openai/gpt-4, anthropic/claude-opus-4). Check openrouter.ai/models for the full list.

OpenRouter config
{
  "agent": {
    "model": "anthropic/claude-opus-4",
    "provider": "openrouter"
  }
}

When to Use OpenRouter

  • Multi-provider setup — Want Claude, GPT, and others without separate keys
  • Experimentation — Try new models quickly
  • Failover — Built-in redundancy across vendors
  • Cost optimization — Compare and switch based on pricing

If you prefer automatic per-request routing (cheapest model that can handle each query), see ClawRouter in the Providers overview—we don't endorse third-party tools.