Add cheap model aliases to your OpenRouter setup for tasks from simple to complex, cutting API costs 50-90% without changing your default model.
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install openclaw-cost-optimizer或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install openclaw-cost-optimizer⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/openclaw-cost-optimizer/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: cost-optimizer version: 1.1.0 description: "Cut your OpenRouter API costs 50-90%. Adds cheap and powerful model aliases to your setup, then advises when to switch models based on task complexity. 8 presets, 29 models, zero config risk — only adds aliases, never changes your default. 3 clicks to set up. NEW: Cost Tracker shows your actual savings, Mix & Match builds custom presets from 29 models, Monthly Calculator estimates your spend. Built by Jeff J Hunter." tags: [cost, models, openrouter, budget, optimization, savings, model-switching, money, api-costs] author: Jeff J Hunter homepage: https://jeffjhunter.com metadata: openclaw: emoji: "💰" requires: bins: ["openclaw"] env: ["OPENROUTER_API_KEY"] stateDirs: ["~/.openclaw"] persistence: "This skill creates ~/.openclaw/cost-tracker.md to log model switches and savings estimates. No network activity, no external API calls beyond OpenRouter (which OpenClaw already uses)." ---
> ## ⛔ AGENT RULES — READ BEFORE DOING ANYTHING > 1. Use EXACT text from this file. Do not paraphrase menus, preset names, or instructions. If you invent preset names, the config-patcher will break. > 2. Only these 8 presets exist: balanced, code-machine, claude-diehards, big-context, openai-focused, tool-master, ultra-budget, free-tier. No others. Never invent names like "strict", "thrifty", "standard", "quality", "performance", "max", "custom" — they don't exist and will cause errors. > 3. NEVER tell the user to open a terminal or run commands. You have the exec tool. USE IT. Run every command yourself via exec. The user's only job is clicking "Approve" on the exec popup. If you find yourself typing "Run this in your terminal" — STOP. Use exec instead. > 4. One step at a time. Run one exec, show the result, explain it, then proceed. > 5. We NEVER change the user's default model, fallbacks, or existing config. We ONLY add model aliases. Their setup stays exactly as it was.
Cut your API costs 50-90%. No terminal. No config editing. 3 clicks.
Right now, every task you give your agent — even "what time is it?" — uses the same expensive model. Heartbeats, pings, simple questions — all billed at the same rate as complex architecture work.
This skill fixes that. It adds cheap and powerful models to your setup, then tells you when to switch to something cheaper or more powerful — with the cost difference and the reason why. You say yes or no. That's it.
Your current default model stays exactly the same. We only ADD options. Nothing is removed or changed.
8 presets. 29 models. Zero risk. Nothing to undo.
NEW in v1.1.0:
Requires: OpenClaw + an OpenRouter API key (free at https://openrouter.ai)
---
---
When the skill loads, the agent introduces itself and shows a menu. The agent must output the EXACT text below:
> 🚨 AGENT: OUTPUT THE EXACT TEXT BELOW VERBATIM. DO NOT PARAPHRASE. DO NOT INVENT YOUR OWN PRESET NAMES. > The formatting, emojis, section headers, pricing indicators, and warnings are all intentional.
👋 The Cost Optimizer skill is now active!
Right now, every task you give me — even simple questions — uses
the same expensive model. That means heartbeats, pings, and
"what time is it?" cost the same as "build me an auth system."
I'm going to fix that. I'll add cheap and powerful models to your
setup, then tell you when to switch. Your current default stays
exactly the same — I only ADD options.
What describes you best?
── RECOMMENDED ──────────────────────────────────
1. 💰 Best balance of cost and quality ¢¢
(recommended for most people)
2. 💻 I mostly write code ¢¢
── MORE OPTIONS ─────────────────────────────────
3. 🟠 I love Claude and want Claude models $$$
4. 📚 I work with huge files or long code $$
5. 🤖 I prefer OpenAI models $$
6. 🔧 I use a lot of tools / MCP servers $$
── BUDGET ───────────────────────────────────────
7. 🪙 Cheapest possible — tight budget ¢
⚠️ Uses free models — may have slow
starts and occasional disconnects
8. 🆓 I want $0 cost — free models only FREE
⚠️ ALL models are free tier — expect
delays, rate limits, and downtime.
Best for testing, not production.
Pricing: FREE = $0 | ¢ < $0.50/M | ¢¢ < $2/M | $$ = $2-15/M | $$$ = $15+/M
(per million tokens — a typical task uses 1K-10K tokens)
Just pick a number. If you're not sure, pick 1.
> AGENT — Preset mapping (do not show this to user): > 1→balanced, 2→code-machine, 3→claude-diehards, 4→big-context, 5→openai-focused, 6→tool-master, 7→ultra-budget, 8→free-tier > Vague answer → balanced. "I don't know" → balanced + "We can change later."
---
After the user picks, the agent explains what models are being added — in plain English.
Example for "balanced":
Great choice! Here's what I'm going to add to your setup:
✅ Flash-Lite — ultra-cheap model for simple tasks (¢)
→ /model flashlite
✅ MiniMax M2.1 — strong coding/writing model (¢¢)
→ /model minimax
✅ Kimi K2.5 — frontier-class for complex work (¢¢)
→ /model kimi25
✅ Gemini Flash — fast all-rounder (¢)
→ /model flash
Your current default model stays exactly the same.
I'm just adding these as options you can switch to anytime.
I'll set this up now — you'll see a couple of Approve popups.
Just click Approve on each one.
---
The agent handles ALL commands via the exec tool. The user never touches a terminal.
> 🚨 AGENT SETUP INSTRUCTIONS: > > Step 3a: Check OpenRouter auth. Use exec: > ``` > openclaw models status > ``` > Look at the output. If OpenRouter auth is missing or shows "No API key found for provider openrouter": > - Tell the user they need an OpenRouter API key from https://openrouter.ai (free) > - Run via exec: openclaw models auth add --provider openrouter > - This starts OpenClaw's built-in interactive auth wizard > - The user follows the prompts to enter their key securely > - NEVER ask the user to paste API keys into chat. Always use the auth wizard via exec. > Keys in chat are a security risk — the auth wizard stores them safely in the credential store. > > Step 3b: Add model aliases. Use exec to run ALL aliases for the chosen preset in ONE command. > See the "Preset Alias Commands" section below for the exact command per preset. > This is ONE exec call → ONE Approve click. > > Step 3c: Restart gateway. Use exec: > ``` > openclaw gateway restart > ``` > Wait for confirmation. ONE more Approve click. > > Total: 2-3 Approve clicks. That's it. > > DO NOT tell users to run commands in a terminal. ALWAYS use exec. > If exec fails, troubleshoot the error and retry exec.
---
Each preset is a single exec command that adds all model aliases at once. Use the EXACT command for the chosen preset:
> AGENT: Copy the exact command below for the user's chosen preset. Do not modify it.
openclaw models aliases add flashlite openrouter/google/gemini-2.5-flash-lite && openclaw models aliases add minimax openrouter/minimax/minimax-m2.1 && openclaw models aliases add kimi25 openrouter/moonshotai/kimi-k2.5 && openclaw models aliases add flash openrouter/google/gemini-2.5-flash
Tiers: Base=flashlite (¢) | Work=minimax (¢¢) | Frontier=kimi25 (¢¢)
...
安装 OpenClaw Cost Optimizer 后,可以对 AI 说这些话来触发它
Help me get started with OpenClaw Cost Optimizer
Explains what OpenClaw Cost Optimizer does, walks through the setup, and runs a quick demo based on your current project
Use OpenClaw Cost Optimizer to add cheap model aliases to your OpenRouter setup for tasks from sim...
Invokes OpenClaw Cost Optimizer with the right parameters and returns the result directly in the conversation
What can I do with OpenClaw Cost Optimizer in my ai agent & automation workflow?
Lists the top use cases for OpenClaw Cost Optimizer, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/openclaw-cost-optimizer/ 目录(个人级,所有项目可用),或 .claude/skills/openclaw-cost-optimizer/(项目级)。重启 AI 客户端后,用 /openclaw-cost-optimizer 主动调用,或让 AI 根据上下文自动发现并使用。
OpenClaw Cost Optimizer 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
OpenClaw Cost Optimizer 可免费安装使用。请查阅仓库了解许可证信息。
Add cheap model aliases to your OpenRouter setup for tasks from simple to complex, cutting API costs 50-90% without changing your default model.
OpenClaw Cost Optimizer 属于「AI Agent & Automation」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my ai agent & automation tasks using OpenClaw Cost Optimizer
Identifies repetitive steps in your workflow and sets up OpenClaw Cost Optimizer to handle them automatically