OpenRouter for Openclaw

OpenRouter is a unified API gateway that provides access to hundreds of AI models through a single, OpenAI-compatible endpoint with centralized billing.

jononovo
v1.0.2
Mar 11, 2026
1
1.7k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install openrouter

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install openrouter using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is OpenRouter?

OpenRouter serves as a powerful abstraction layer for the fragmented AI landscape. By providing a single API key and a unified credit balance, it allows developers to access over 300 models from more than 60 providers including Anthropic, OpenAI, Google, and Meta. This skill eliminates the need to manage multiple provider accounts, different billing cycles, and various API formats.

Built for reliability and flexibility, OpenRouter includes features like automatic provider fallbacks, edge routing for low latency, and Zero Completion Insurance. Whether you are building a small prototype using free models or a high-scale enterprise application, this Openclaw Skills integration streamlines the technical overhead of model management and procurement.

OpenRouter Use Cases

  • Switching between top-tier models like Claude 3.5 Sonnet and GPT-4o without changing code architecture.
  • Implementing automatic failover strategies to ensure high availability when specific providers experience downtime.
  • Reducing costs by routing non-critical tasks to free models or low-cost providers through a single interface.
  • Maintaining privacy compliance using Zero Data Retention (ZDR) for sensitive data processing.
  • Consolidating AI expenses into a single bill across dozens of independent model providers.

How OpenRouter Works

  1. The user sends a request to the OpenRouter API gateway using a standard OpenAI-compatible JSON payload.
  2. OpenRouter analyzes the requested model ID and identifies available providers offering that specific model.
  3. The gateway applies any specified routing logic, such as provider prioritization, regional pinning, or latency thresholds.
  4. If the primary provider is unavailable, OpenRouter automatically attempts the request with a fallback provider to ensure completion.
  5. The model response is returned to the user through the unified API, and the cost is deducted from a single OpenRouter credit balance.

OpenRouter Setup

To get started with this OpenRouter skill, you must set up your environment credentials:

  1. Sign up at openrouter.ai and add credits or use free models.
  2. Generate an API Key in the Settings dashboard.
  3. Export the key as an environment variable:
export OPENROUTER_API_KEY="sk-or-v1-..."
  1. Update your application base URL to [https://openrouter.ai/api/v1](https://openrouter.ai/api/v1) to begin routing requests.

OpenRouter Data Schema & Taxonomy

OpenRouter uses a standardized OpenAI-compatible schema for seamless integration. Data is organized by model IDs and provider endpoints as shown below:

Attribute Description
Model ID Formatted as provider/model-name (e.g., anthropic/claude-3-sonnet)
Base URL [https://openrouter.ai/api/v1](https://openrouter.ai/api/v1) for all model interactions
Headers Requires Authorization: Bearer $OPENROUTER_API_KEY
Metadata Supports site name and URL headers for ranking on OpenRouter leaderboards
Response Standard ChatCompletion object including usage stats and model fingerprints

OpenRouter Advanced Features

  • Bring Your Own Key (BYOK): Use your own API keys from AWS Bedrock, Azure, or Vertex AI while utilizing OpenRouter routing.
  • Nitro Routing: Speed-optimized routing paths enabled by appending :nitro to model slugs.
  • Web Search Integration: On-the-fly web search capabilities powered by Exa.ai via the :online model suffix.
  • Prompt Caching: Support for provider-level context caching to reduce costs by up to 90% on repetitive inputs.
  • Zero Completion Insurance: Automatic protection where users are only charged for successful API responses.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Requires
Github Stars: 0
forks: 0

Featured*