openrouter-toolkit
The definitive OpenRouter skill — intelligent model routing by task type, cost tracking with budget alerts, automatic fallback chains, side-by-side model comparison, and savings recommendations. Use for optimizing AI model selection, controlling costs, and building resilient LLM pipelines.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/aiwithabidi/openrouter-toolkitWhat This Skill Does
The openrouter-toolkit is a comprehensive management layer for your OpenClaw agent, designed to orchestrate LLM interactions through the OpenRouter API. At its core, the toolkit functions as an intelligent load balancer and financial controller. It automates model selection based on task-specific heuristics, ensuring that you aren't using an expensive flagship model for simple text classification, while ensuring that complex coding or reasoning tasks receive the high-parameter models they require. Beyond routing, it provides a persistent audit trail for API expenditures via a local SQLite database, allows for seamless fallback orchestration if a provider experiences downtime, and enables native model comparison benchmarks without leaving your terminal environment.
Installation
To integrate this skill into your workflow, ensure your environment meets the Python 3.10+ requirement. Execute the following installation command in your terminal:
clawhub install openclaw/skills/skills/aiwithabidi/openrouter-toolkit
Once installed, you must configure your credentials. Locate your OpenRouter API key and export it as an environment variable: export OPENROUTER_API_KEY='your_key_here'. The toolkit automatically initializes the local SQLite database at {baseDir}/data/openrouter_costs.db upon the first request.
Use Cases
- Automated Cost Optimization: Developers can set strict monthly budget thresholds to prevent accidental overspending on high-token-count models during recursive agent loops.
- Resilient Pipeline Construction: Build agents that automatically retry failed requests on cheaper, faster fallback models to ensure continuous uptime.
- A/B Testing Prompts: Rapidly compare the output quality of different providers (e.g., Anthropic vs. OpenAI) for the same system prompt to fine-tune agent personality.
- Developer Productivity: Use the command-line interface to quickly query the current best models for specific categories like 'code' or 'creative' without navigating browser interfaces.
Example Prompts
- "OpenClaw, use the openrouter-toolkit to route my current coding task to the best available model for complex logic."
- "Compare the output of Claude 3.5 Sonnet and GPT-4o-mini for my current creative writing prompt and show me the cost difference."
- "Set a monthly budget alert of $20.00 in the openrouter-toolkit and check my current spend for the week."
Tips & Limitations
When using the toolkit, prioritize the 'fast' and 'cheap' routing tasks for background processes and non-critical operations to maximize your API budget. Be aware that the fallback chain adds slight latency as it waits for a primary model timeout before triggering subsequent attempts. The tool relies on local SQLite storage, so ensure your agent has write permissions in the {baseDir}/data/ directory. Note that the toolkit pulls live data from the OpenRouter API; therefore, internet connectivity is mandatory for accurate model list updates and budget verification checks.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-aiwithabidi-openrouter-toolkit": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: network-access, file-write, file-read, external-api
Related Skills
agent-memory
Full AI agent memory stack — Mem0 unified memory engine with vector search (Qdrant) and knowledge graph (Neo4j), plus SQLite for structured data. Complete setup script and tools. Give your OpenClaw agent a real brain with semantic recall, entity relationships, and structured storage.
skill-auditor
Security audit and quarantine system for third-party OpenClaw skills. Use when evaluating, reviewing, or installing any skill from ClawHub or external sources. Automatically triggered before any skill installation.
Model Intel
Live LLM model intelligence and pricing from OpenRouter
deep-search
Multi-tier Perplexity search with Langfuse tracing. Three depth levels: quick (sonar), pro (sonar-pro), deep (sonar-reasoning-pro). Supports focus modes: internet, academic, news, youtube, reddit. Returns AI-synthesized answers with citations. Use for research, comparisons, market analysis, fact-checking. Triggers: search, research, look up, find out, compare, what is, deep search, web research.
amplitude
Amplitude product analytics — track events, analyze user behavior, run cohort analysis, manage user properties, and query funnel/retention data via the Amplitude API. Understand product usage, measure feature adoption, and analyze user journeys. Built for AI agents — Python stdlib only, zero dependencies. Use for product analytics, user behavior tracking, funnel analysis, retention analysis, and cohort segmentation.