惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Recent Commits to openclaw:main
Recent Commits to openclaw:main
L
LangChain Blog
月光博客
月光博客
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 【当耐特】
宝玉的分享
宝玉的分享
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Last Week in AI
Last Week in AI
人人都是产品经理
人人都是产品经理
博客园_首页
T
Tailwind CSS Blog
P
Proofpoint News Feed
雷峰网
雷峰网
D
Darknet – Hacking Tools, Hacker News & Cyber Security
IT之家
IT之家
V
Vulnerabilities – Threatpost
阮一峰的网络日志
阮一峰的网络日志
C
CERT Recently Published Vulnerability Notes
Attack and Defense Labs
Attack and Defense Labs
S
Schneier on Security
Security Archives - TechRepublic
Security Archives - TechRepublic
L
Lohrmann on Cybersecurity
V
Visual Studio Blog
云风的 BLOG
云风的 BLOG
WordPress大学
WordPress大学
The Register - Security
The Register - Security
N
Netflix TechBlog - Medium
Hugging Face - Blog
Hugging Face - Blog
Project Zero
Project Zero
博客园 - 叶小钗
F
Full Disclosure
大猫的无限游戏
大猫的无限游戏
Latest news
Latest news
S
SegmentFault 最新的问题
C
Cyber Attacks, Cyber Crime and Cyber Security
Google Online Security Blog
Google Online Security Blog
Recorded Future
Recorded Future
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Hacker News - Newest:
Hacker News - Newest: "LLM"
腾讯CDC
L
LINUX DO - 最新话题
Google DeepMind News
Google DeepMind News
P
Privacy International News Feed
I
InfoQ
F
Fortinet All Blogs
Vercel News
Vercel News
H
Hackread – Cybersecurity News, Data Breaches, AI and More
T
Threatpost
T
Tenable Blog
B
Blog RSS Feed

OpenRouter Blog

Choosing the Optimal Image Input Detail Level in LLMs — OpenRouter Blog DeepSeek V4 Is Earning Agentic Token Share — OpenRouter Blog The Open Weight Models that Matter: June 2026 — OpenRouter Blog The OpenRouter MCP Server — OpenRouter Blog Introducing the Unified Image API — OpenRouter Blog The AI Governance Checklist That Maps to Your Stack — OpenRouter Blog Enforce AI Data Residency at the Routing Layer — OpenRouter Blog OpenRouter vs Portkey: Routing Network vs Control Plane — OpenRouter Blog OpenRouter vs LiteLLM: Managed vs Self-Hosted Gateway — OpenRouter Blog Connect SillyTavern to OpenRouter: Setup, Models, Fixes — OpenRouter Blog A Robot is Sprinting Towards You: Do You Want it Running on Claude or Grok? Kilo Code + OpenRouter: Setup, Routing, and Free Models — OpenRouter Blog Codex CLI with OpenRouter: config.toml Setup and Models — OpenRouter Blog Claude Code with OpenRouter: Setup, Models, and Costs — OpenRouter Blog How to Use OpenRouter With Any Coding Agent or AI Tool — OpenRouter Blog Subagent: Let Your Model Delegate the Busywork — OpenRouter Blog Free LLM API in 2026: 13 Options Ranked and Compared — OpenRouter Blog How to Enforce Agentic AI Governance at the API Layer — OpenRouter Blog Keep Your Agent Running When Models Disappear — OpenRouter Blog Hermes Agent + OpenRouter: Setup, Model Choice & Routing Config — OpenRouter Blog Lowest-Cost LLM Inference: The Complete OpenRouter Guide — OpenRouter Blog How OpenRouter Model Routing Works: Providers, Fallbacks & Auto Router — OpenRouter Blog OpenRouter Failover: Provider Failover vs Model Fallbacks Explained — OpenRouter Blog Surpassing Frontier Performance with Fusion — OpenRouter Blog Dinner is Served — OpenRouter Blog LLM Gateway: What It Is and How to Choose One — OpenRouter Blog Advisor: Give Any Model a Lifeline to a Smarter One — OpenRouter Blog Gemini 2.5 Flash API - Pricing, Quickstart & Provider Comparison — OpenRouter Blog EU AI Act & Colorado ADMT Compliance: Human Oversight for AI Agents — OpenRouter Blog May Release Spotlight — OpenRouter Blog Guardrails: Protect your Agents, Data, and Costs — OpenRouter Blog OpenRouter Raises $113M Series B — OpenRouter Blog Human-in-the-Loop Tools for the Agent SDK — OpenRouter Blog Consistent Web Search and Fetch Across Every Model — OpenRouter Blog GPT-5.5 Price Increase: What It Actually Costs — OpenRouter Blog New Audio APIs for Speech and Transcription — OpenRouter Blog Response Caching: Zero Cost for Identical Requests — OpenRouter Blog April Release Spotlight — OpenRouter Blog Create OpenRouter Accounts via CLI with Stripe Projects — OpenRouter Blog Opus 4.7 Agent SDK: Building Multi-turn Agent Workflows on OpenRouter — OpenRouter Blog Build Your Own Harness with the Agent SDK — OpenRouter Blog Introducing Workspaces — OpenRouter Blog Announcing Video Generation — OpenRouter Blog Auto Exacto: Adaptive Quality Routing, On by Default — OpenRouter Blog February Release Spotlight — OpenRouter Blog OpenRouter Outages on February 17 and 19, 2026 — OpenRouter Blog January Release Spotlight — OpenRouter Blog Distillable Models and Synthetic Data Pipelines with NeMo Data Designer — OpenRouter Blog December Release Spotlight — OpenRouter Blog Response Healing: Reduce JSON Defects by 80%+ — OpenRouter Blog The 2025 State of AI Report — OpenRouter Blog Is Implicit Caching Prompt Retention? — OpenRouter Blog Provider Variance: Introducing Exacto — OpenRouter Blog 1 million free BYOK requests per month — OpenRouter Blog The First-Ever Image Model Is Up on OpenRouter — OpenRouter Blog GPT-5 is now live — OpenRouter Blog Audio Inputs and PDF URLs for Apps — OpenRouter Blog Presets: How To Seamlessly Transfer Model Configurations Across Apps — OpenRouter Blog New Privacy-Focused Provider Drop: Venice — OpenRouter Blog Use OpenRouter Models in Cursor: Try it with Moonshot AI Updates to Our Free Tier: Sustaining Accessible AI for Everyone — OpenRouter Blog New Stealth Model: "Cypher Alpha" — OpenRouter Blog Introducing Presets: Manage LLM Configs from Your Dashboard! — OpenRouter Blog Dev & BYOK Updates: Uptime API + Smarter Key Management — OpenRouter Blog Simplifying Our Platform Fee — OpenRouter Blog GIF Prompts, Omni Search, Tool Caching, and BYOK Flags — OpenRouter Blog New Features: Reasoning Streams, Crypto Invoices, End-User IDs & More — OpenRouter Blog Passkeys, DevEx Upgrades, and a New Guide for TypeScript Agents — OpenRouter Blog New Provider Drop: Cerebras Is Here — OpenRouter Blog Better Insights, Faster Metrics, and New Developer Power Tools — OpenRouter Blog Privacy Clarity, New Providers, OAuth Upgrade, and Gemini Gets Parallel Tools — OpenRouter Blog Universal PDF Support — OpenRouter Blog Smarter Charts, Inline SVGs, and Live Usage Accounting — OpenRouter Blog Quasar Alpha and Optimus Alpha Reveal — OpenRouter Blog "Stealth" model: Optimus Alpha — OpenRouter Blog “Stealth” model: Quasar Alpha — OpenRouter Blog Never Pay for Empty AI Responses Again — OpenRouter Blog Deep Research & Many New Models — OpenRouter Blog Introducing Nitro and Floor Price Shortcuts — OpenRouter Blog Introducing Cloudflare as a new provider — OpenRouter Blog Reasoning Tokens for Thinking Models — OpenRouter Blog Introducing Web Search via the API — OpenRouter Blog Standardized finish reasons — OpenRouter Blog Happy New Year! Introducing a new Auto Router — OpenRouter Blog Holiday launches: Web Search & Price Cuts — OpenRouter Blog Bring Your Own API Keys — OpenRouter Blog Crypto Payments API — OpenRouter Blog Structured Outputs & Free Gemini Flash 2.0 — OpenRouter Blog Price Drops and Llama 3.3 70b — OpenRouter Blog Author Pages & Amazon Nova — OpenRouter Blog
Connect OpenClaw to OpenRouter: One Key, Failover, Free Models — OpenRouter Blog
OpenRouter · 2026-06-19 · via OpenRouter Blog

OpenClaw runs AI agents across Telegram, Discord, Slack, Signal, iMessage, and WhatsApp from one place. It’s open source and it needs a model provider behind it. Point it at one provider directly and you own that relationship: one key, one bill, and an agent that stops the moment that provider has a bad minute.

OpenClaw ships with built-in OpenRouter support, so one key reaches 300+ models across 70+ providers, billing lands in one place, and requests fail over to another provider automatically. The connection is a single command. This guide covers that setup, then the model format, failover, cost controls, and the errors that come up most.

Connect OpenClaw to OpenRouter in one command

Run the onboard command with your key:

openclaw onboard --auth-choice apiKey --token-provider openrouter --token "$OPENROUTER_API_KEY"

That writes your credential to ~/.openclaw/openclaw.json and sets the openrouter/auto model. You’re connected.

If you’d rather edit the config by hand, the file lives at ~/.openclaw/openclaw.json under the home directory of the user running OpenClaw. A minimal config needs your key and one model:

{
  "env": {
    "OPENROUTER_API_KEY": "sk-or-..."
  },
  "agents": {
    "defaults": {
      "model": {
        "primary": "openrouter/openrouter/auto"
      },
      "models": {
        "openrouter/openrouter/auto": {}
      }
    }
  }
}

On a server, set the key in the env block rather than a shell profile. A service that runs under a different user or shell won’t pick up an interactive profile, and the env block is injected with the process at start time. To change the key later, edit env.OPENROUTER_API_KEY and restart with openclaw gateway run.

Then confirm your models loaded:

openclaw models list

OpenClaw references OpenRouter models as openrouter/<author>/<slug>. Prefix the author with ~ to track the latest version in a family, or drop it to pin an exact version. Check the current slug on the models page before you commit one, since identifiers change as new versions ship.

ModelReference
Claude Sonnet (latest)openrouter/~anthropic/claude-sonnet-latest
Gemini Flash (latest)openrouter/~google/gemini-flash-latest
DeepSeekopenrouter/deepseek/deepseek-chat
Kimi (latest)openrouter/~moonshotai/kimi-latest
Llama 3.3 70Bopenrouter/meta-llama/llama-3.3-70b-instruct

Append a variant suffix to change routing on the same model. :free routes to a free endpoint, :nitro sorts providers by throughput, and :thinking asks for extended reasoning. To change an agent’s model later, update agents.defaults.model.primary and restart the gateway.

The Auto Router is referenced as openrouter/openrouter/auto: the author is openrouter and the model is auto. That double openrouter is easy to get wrong, and it’s the fix for the unknown model error below.

Keep agents running when a provider drops

A one-off API call that fails is easy to retry. An OpenClaw agent holding state across a multi-step Telegram conversation is not, since a mid-run failure can leave a message that looks sent but wasn’t, or a tool call that never returned. OpenRouter handles that at two levels.

Provider failover is automatic. Most models are served by more than one provider, and if the first one OpenRouter tries is down or rate-limiting you, it routes the same request to another. You don’t configure it, and you’re billed only for the request that completes.

Model fallbacks cover the case where a model is unavailable everywhere. Add a fallbacks array and OpenRouter tries each model in order:

{
  "agents": {
    "defaults": {
      "model": {
        "primary": "openrouter/~anthropic/claude-sonnet-latest",
        "fallbacks": [
          "openrouter/~google/gemini-flash-latest",
          "openrouter/deepseek/deepseek-chat"
        ]
      }
    }
  }
}

The two stack. Provider failover swaps providers behind one model; the fallback array swaps models entirely. Check the model field in the response to see which one ran. See the model fallbacks docs for the full configuration.

If your prompts carry data-residency or compliance requirements, restrict routing to providers that don’t retain request data using the data_collection and zdr provider-routing controls. The provider selection docs cover the parameters, and provider logging lists which providers qualify.

Match models to agents to control cost

Running one capable model for every agent action wastes money on work that doesn’t need it. A research agent reading long documents needs a frontier model. A summarizer handling short text runs fine on a free Llama. A bot fielding quick questions runs fine on Gemini Flash.

The Auto Router (openrouter/openrouter/auto), powered by NotDiamond, picks a cost-effective model per request and charges that model’s standard rate with no extra routing fee. It’s a good default for agent traffic that’s mostly low-stakes work like heartbeats and status checks.

When you want explicit control, OpenClaw lets you split models by agent. Set a per-agent override under agents.overrides.<name>.model:

{
  "agents": {
    "overrides": {
      "researcher": {
        "model": { "primary": "openrouter/anthropic/claude-opus-4.6" }
      },
      "summarizer": {
        "model": { "primary": "openrouter/meta-llama/llama-3.3-70b-instruct:free" }
      }
    }
  }
}

On cost: OpenRouter doesn’t mark up provider pricing. On pay-as-you-go the platform fee is 5.5%, and that one fee covers unified billing, failover, and one key across every provider. For low-stakes actions, 20+ free models cost nothing per token. If you bring your own provider keys, the BYOK fee is 5%, waived for the first 1M requests each month. Track spend per model on the Activity dashboard.

The unified endpoint earns its keep once you run more than one model, want requests to survive an outage, or want to switch models by editing a string.

Fix the most common connection errors

“No API key found for provider ‘openrouter’” means the key isn’t reaching OpenClaw. Run echo $OPENROUTER_API_KEY to check it, verify your auth config with openclaw auth list, or re-run the onboard command. On a VPS, the usual cause is the variable loading in your interactive shell but not in the service’s shell, so set it in the config env block.

“unknown model: openrouter/auto” means the Auto Router reference is wrong. Use openrouter/openrouter/auto and list it under agents.defaults.models. OpenClaw expects the full openrouter/<author>/<slug> path.

“OpenRouter not responding” means requests are going out with nothing coming back. Work through four checks: confirm your credit balance at openrouter.ai/keys, run openclaw models list to confirm the slug resolves, run openclaw logs --follow to read the actual error, and make sure your host can reach https://openrouter.ai/api/v1. An egress rule blocking that host produces exactly this no-response.

401 or 403 errors are account-side: the key is invalid, revoked, or out of credits. Check it at openrouter.ai/keys, update env.OPENROUTER_API_KEY, and restart the gateway.

Frequently asked questions

How do I connect OpenClaw to OpenRouter?

Run openclaw onboard --auth-choice apiKey --token-provider openrouter --token "$OPENROUTER_API_KEY". It writes your credential and sets the openrouter/auto model. You don’t need a base URL or a models.providers block.

What model-reference format does OpenClaw use?

openrouter/<author>/<slug>, for example openrouter/deepseek/deepseek-chat. Add a ~ before the author to track the latest version in a family (openrouter/~anthropic/claude-sonnet-latest), or append :free, :nitro, or :thinking to change routing behavior.

How do I fix “unknown model: openrouter/auto”?

Use openrouter/openrouter/auto and list it under agents.defaults.models. OpenClaw expects the full openrouter/<author>/<slug> path, and the Auto Router’s author is openrouter.

Can I use free OpenRouter models with OpenClaw?

Yes. Append :free to the reference, such as openrouter/meta-llama/llama-3.3-70b-instruct:free. Pair it with a fallback so the agent keeps running when a free slot is busy.

Do I need to set a base URL for OpenClaw?

No. OpenClaw’s built-in OpenRouter support handles routing internally. Set the API key and reference models with openrouter/<author>/<slug>.