OpenRouter Toolkit for Openclaw

A comprehensive toolkit for intelligent model routing, cost tracking, and resilient LLM pipelines using OpenRouter.

aiwithabidi
v1.0.0
Mar 6, 2026
1
561
5

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install openrouter-toolkit

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-toolkit 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 Toolkit?

The OpenRouter Toolkit is a specialized skill designed to streamline how AI agents interact with Large Language Models. By leveraging the OpenRouter API, it provides a unified interface for selecting the most appropriate models based on specific task requirements like coding, reasoning, or cost-efficiency. This ensures that developers can build highly optimized and cost-effective AI applications without manual model switching.

Beyond simple routing, this skill acts as a financial and reliability layer for your AI stack. It features built-in budget monitoring to prevent unexpected costs and robust fallback mechanisms that ensure your agents remain operational even if a primary model provider experiences downtime. It is an essential component for any developer looking to expand their library of Openclaw Skills with enterprise-grade model management.

OpenRouter Toolkit Use Cases

  • Automating model selection for specific task types like code generation or creative writing.
  • Implementing cost-control measures and budget alerts for multi-model deployments.
  • Ensuring high availability through automated fallback chains when primary models fail.
  • Performing side-by-side quality and cost comparisons between different LLMs.

How OpenRouter Toolkit Works

  1. Authentication: The skill initializes using the OPENROUTER_API_KEY to access live model data and pricing.
  2. Task Scoring: When a request is made, the toolkit evaluates available models against task-specific heuristics such as context window for code or latency for fast tasks.
  3. Execution & Fallback: The primary model is called; if it fails or times out, the system automatically progresses through a pre-defined fallback chain.
  4. Cost Logging: Every successful API call is recorded in a local SQLite database, tracking token usage and monetary spend.
  5. Analysis: Users can query the local database for spending reports or check current budget status against limits.

OpenRouter Toolkit Setup

To get started with this addition to your Openclaw Skills, ensure you have Python 3.10+ installed and your OpenRouter API key ready.

export OPENROUTER_API_KEY='your_api_key_here'
# Route a task based on priority
python3 scripts/openrouter_toolkit.py route --task code
# Set a budget limit
python3 scripts/openrouter_toolkit.py budget --set 50.00

OpenRouter Toolkit Data Schema & Taxonomy

The skill maintains a structured local database to manage financial data and model metadata to ensure transparency in your Openclaw Skills usage.

Data Component Format Description
Cost Logs SQLite Located at {baseDir}/data/openrouter_costs.db, storing timestamps, models, and costs.
Budget Config Local Storage Maintains user-defined spending limits and alert thresholds.
Model Cache Memory/API Real-time pricing and capability data pulled directly from OpenRouter.

OpenRouter Toolkit Advanced Features

  • Multi-model side-by-side comparison for prompt engineering and quality benchmarking.
  • Granular budget alerts with threshold-based warnings to prevent overspending.
  • Real-time pricing and capability synchronization via OpenRouter's live API endpoints.
  • Customizable fallback chains to maintain 100% uptime for critical agent workflows.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Requires
Github Stars: 0
forks: 0

Featured*