ClawAPI Manager
by @2233admin
OpenClaw-native API management and cost optimization. Multi-provider key management, real-time monitoring, smart routing, and automated failover.
clawhub install clawapi-manager📖 About This Skill
name: clawapi-manager slug: clawapi-manager version: 1.1.2 author: 2233admin description: OpenClaw API management and cost optimization. Manages multi-provider keys, monitors costs, routes tasks intelligently, and provides automated failover. Use when managing API keys, tracking costs, or optimizing API spending. Triggers: "api key", "cost", "budget", "provider", "validate config", "fix config".
ClawAPI Manager
> 🔧 Professional API management and cost optimization for OpenClaw deployments
English
Overview
ClawAPI Manager is an OpenClaw-native tool for managing API keys, monitoring costs, and optimizing API spending through intelligent routing. It saves 30-90% on API costs by automatically routing simple tasks to free models.
Capabilities
How to Use
#### 1. Installation
cd ~/.openclaw/workspace/skills
git clone https://github.com/2233admin/clawapi-manager.git
cd clawapi-manager
pip install -r requirements.txt
#### 2. Basic Commands
# List all providers
python3 claw_api_manager_central.py listValidate configuration
python3 claw_api_manager_central.py validateAuto-fix configuration issues
python3 claw_api_manager_central.py fixUpdate API key
python3 claw_api_manager_central.py update provider-name new-keyAdd new provider
python3 claw_api_manager_central.py add provider-name https://api.example.com sk-key anthropic-messages
#### 3. Configuration
# Create example configs
cp config/managed_keys_central.json.example config/managed_keys_central.json
cp config/openrouter_keys.json.example config/openrouter_keys.jsonEdit with your keys
nano config/managed_keys_central.json
Example Usage
Scenario 1: Validate Configuration
User: "Check if my OpenClaw config is valid"
Assistant: [Runs validate command, reports issues]
Scenario 2: Auto-Fix Issues
User: "Fix my config errors"
Assistant: [Runs fix command, repairs common issues]
Scenario 3: Add OpenRouter Key
User: "Add this OpenRouter key: sk-or-v1-xxx"
Assistant: [Adds key, configures rotation]
Scripts
claw_api_manager_central.py: Main management CLIlib/config_manager.py: Configuration management corelib/key_rotation.py: Automated key rotationlib/cost_monitor.py: Cost tracking and reportinglib/smart_router.py: Intelligent task routingLimitations
Troubleshooting
Issue: "Unknown model" error
python3 claw_api_manager_central.py validatepython3 claw_api_manager_central.py fixopenclaw gateway restartIssue: Key rotation not working
config/openrouter_keys.json existsenabled: true~/.openclaw/logs/gateway.log中文
概述
ClawAPI Manager 是 OpenClaw 原生的 API 管理和成本优化工具。通过智能路由自动将简单任务分配给免费模型,节省 30-90% 的 API 成本。
功能
使用方法
#### 1. 安装
cd ~/.openclaw/workspace/skills
git clone https://github.com/2233admin/clawapi-manager.git
cd clawapi-manager
pip install -r requirements.txt
#### 2. 基本命令
# 列出所有 providers
python3 claw_api_manager_central.py list验证配置
python3 claw_api_manager_central.py validate自动修复配置问题
python3 claw_api_manager_central.py fix更新 API Key
python3 claw_api_manager_central.py update provider-name new-key添加新 provider
python3 claw_api_manager_central.py add provider-name https://api.example.com sk-key anthropic-messages
#### 3. 配置
# 创建示例配置
cp config/managed_keys_central.json.example config/managed_keys_central.json
cp config/openrouter_keys.json.example config/openrouter_keys.json编辑你的密钥
nano config/managed_keys_central.json
使用示例
场景 1:验证配置
用户:"检查我的 OpenClaw 配置是否正确"
助手:[运行 validate 命令,报告问题]
场景 2:自动修复
用户:"修复我的配置错误"
助手:[运行 fix 命令,修复常见问题]
场景 3:添加 OpenRouter 密钥
用户:"添加这个 OpenRouter 密钥:sk-or-v1-xxx"
助手:[添加密钥,配置轮换]
脚本
claw_api_manager_central.py:主管理 CLIlib/config_manager.py:配置管理核心lib/key_rotation.py:自动密钥轮换lib/cost_monitor.py:成本追踪和报告lib/smart_router.py:智能任务路由限制
故障排除
问题:"Unknown model" 错误
python3 claw_api_manager_central.py validatepython3 claw_api_manager_central.py fixopenclaw gateway restart问题:密钥轮换不工作
config/openrouter_keys.json 是否存在enabled: true~/.openclaw/logs/gateway.log📖 详细文档: README.md
🐛 问题反馈: GitHub Issues
🚀 快速开始: 运行 python3 claw_api_manager_central.py --help
📋 Tips & Best Practices
Issue: "Unknown model" error
python3 claw_api_manager_central.py validatepython3 claw_api_manager_central.py fixopenclaw gateway restartIssue: Key rotation not working
config/openrouter_keys.json existsenabled: true~/.openclaw/logs/gateway.log