返回顶部
o

openrouter-toolkitOpenRouter工具包

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.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
496
下载量
免费
免费
1
收藏
概述
安装方式
版本历史

openrouter-toolkit

🔀 OpenRouter 工具包

面向 OpenClaw 智能体的终极 OpenRouter 技能。智能模型路由、成本追踪、回退链和模型对比——一应俱全。

功能特性

  • - 智能路由 — 自动为代码、推理、创意、快速或低成本任务选择最佳模型
  • 成本追踪 — 记录每次 API 调用的成本,追踪日/周/月支出
  • 回退链 — 若主模型失败或超时,自动使用备用模型重试
  • 模型对比 — 向 N 个模型发送相同提示,并排比较质量和成本
  • 预算提醒 — 设置支出限额,在超支前收到警告
  • 实时模型数据 — 从 OpenRouter API 获取实时定价和功能信息

前提条件

  • - OPENROUTERAPIKEY — 你的 OpenRouter API 密钥
  • Python 3.10+ 并安装 requests(大多数环境已预装)

使用方法

智能路由

bash python3 {baseDir}/scripts/openrouter_toolkit.py route --task code python3 {baseDir}/scripts/openrouter_toolkit.py route --task reasoning python3 {baseDir}/scripts/openrouter_toolkit.py route --task creative python3 {baseDir}/scripts/openrouter_toolkit.py route --task fast python3 {baseDir}/scripts/openrouter_toolkit.py route --task cheap

模型对比

bash python3 {baseDir}/scripts/openrouter_toolkit.py compare --prompt 解释递归 --models anthropic/claude-sonnet-4,openai/gpt-4o-mini

回退链

bash python3 {baseDir}/scripts/openrouter_toolkit.py fallback --prompt 你好 --chain anthropic/claude-opus-4,anthropic/claude-sonnet-4,openai/gpt-4o-mini

成本追踪

bash python3 {baseDir}/scripts/openrouter_toolkit.py cost --period daily python3 {baseDir}/scripts/openrouter_toolkit.py cost --period weekly python3 {baseDir}/scripts/openrouter_toolkit.py cost --period monthly

预算提醒

bash python3 {baseDir}/scripts/openrouter_toolkit.py budget --set 50.00 python3 {baseDir}/scripts/openrouter_toolkit.py budget --check

列出模型

bash python3 {baseDir}/scripts/openrouter_toolkit.py models --top 20 python3 {baseDir}/scripts/openrouter_toolkit.py models --search claude python3 {baseDir}/scripts/openrouter_toolkit.py models --best code

智能路由工作原理

路由器根据任务类型使用以下启发式方法对模型进行评分:

任务优先级示例模型
代码高上下文、代码基准测试Claude Opus, GPT-4o
推理
思考/推理能力 | Claude Opus, o1 |
| 创意 | 创意写作质量 | Claude Sonnet, GPT-4o |
| 快速 | 低延迟、足够好的质量 | Claude Haiku, GPT-4o-mini |
| 低成本 | 每 token 最低成本 | Gemini Flash, GPT-4o-mini |

数据存储

成本日志存储在 SQLite 数据库中,路径为 {baseDir}/data/openrouter_costs.db。

致谢

M. Abidi 构建 | agxntsix.ai YouTube | GitHub 属于面向 OpenClaw 智能体的 AgxntSix 技能套件 的一部分。

📅 需要为你的业务设置 OpenClaw? 预约免费咨询

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 openrouter-toolkit-1776203489 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 openrouter-toolkit-1776203489 技能

通过命令行安装

skillhub install openrouter-toolkit-1776203489

下载

⬇ 下载 openrouter-toolkit v1.0.0(免费)

文件大小: 6.4 KB | 发布时间: 2026-4-15 10:16

v1.0.0 最新 2026-4-15 10:16
openrouter-toolkit 1.0.0

- Initial release of the definitive OpenRouter skill for OpenClaw agents.
- Supports intelligent model routing by task (code, reasoning, creative, fast, cheap).
- Includes cost tracking, budget alerts, and automatic fallback chains.
- Enables side-by-side model comparison and provides savings recommendations.
- Fetches live pricing and capabilities from the OpenRouter API.
- Requires Python 3.10+ and an OpenRouter API key.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部