ClawCap — Spending Cap for OpenClaw
Stop runaway API bills. ClawCap enforces hard spending caps across every model your agents use — Claude, GPT, Gemini, and more — under a single proxy URL.
What It Does
- - Hard daily & monthly caps — your agents stop when you hit your limit, not when your wallet is empty
- All models, one cap — Claude, GPT, Gemini, DeepSeek, Mistral, and more tracked together
- Heartbeat detection — catches agents stuck in polling loops burning tokens
- Loop detection — stops agents repeating the same failed request
- Kill switch — stop any agent instantly via Telegram or API
- Real-time tracking — see exactly what you're spending per model
Setup (2 minutes)
1. Get Your Token
Sign up at clawcap.co and grab your proxy token. Free tier works instantly — no credit card needed.
Set it as an environment variable:
CODEBLOCK0
2. Run Setup
The setup script automatically patches your OpenClaw config to route all providers through ClawCap:
CODEBLOCK1
This will:
- - Read your INLINECODE0
- Point every provider's
baseUrl to your ClawCap proxy URL - Back up your original config to INLINECODE2
3. Done — You're Protected
Start OpenClaw normally. All requests now flow through ClawCap and your spending caps are enforced automatically.
Check your spend anytime:
CODEBLOCK2
Manual Setup
If you prefer to configure manually, set every provider's baseUrl in ~/.openclaw/openclaw.json to:
CODEBLOCK3
Your API keys stay the same — ClawCap only reads them to forward requests, never stores them.
Environment Variables
| Variable | Description |
|---|
| INLINECODE5 | Your ClawCap proxy token (starts with cc_live_) |
Plans
| Plan | Price | Features |
|---|
| Free | $0 | $5/day cap, kill switch, heartbeat detection |
| Solo |
$5/mo | Custom caps, heartbeat+loop protection, Telegram alerts |
| Pro | $15/mo | Multi-agent tracking, per-model analytics, custom alert thresholds, weekly spend reports |
Troubleshooting
Agent not routing through ClawCap: Check that baseUrl in your openclaw.json points to https://clawcap.co/proxy/cc_live_... — not the original API URL.
429 errors: You've hit your spending cap. Check /status to see current spend, or upgrade your plan for higher limits.
Token not working: Make sure you're using the full cc_live_... token from your setup page, not just the email.
Links
技能名称: clawcap
详细描述:
ClawCap — OpenClaw 的消费上限控制
杜绝 API 费用失控。ClawCap 通过单一代理 URL,为您的智能体所使用的所有模型(Claude、GPT、Gemini 等)强制执行硬性消费上限。
功能特性
- - 硬性日/月消费上限 — 达到限额时智能体自动停止,而非钱包耗尽时才停止
- 多模型统一限额 — 统一追踪 Claude、GPT、Gemini、DeepSeek、Mistral 等模型
- 心跳检测 — 捕捉陷入轮询循环浪费 Token 的智能体
- 循环检测 — 阻止智能体重复发送相同的失败请求
- 紧急终止 — 通过 Telegram 或 API 即时停止任意智能体
- 实时追踪 — 清晰查看每个模型的消费情况
配置指南(2分钟)
1. 获取令牌
在 clawcap.co 注册并获取代理令牌。免费版即刻可用,无需信用卡。
将其设置为环境变量:
bash
export CLAWCAPTOKEN=ccliveyourtoken_here
2. 运行配置
配置脚本会自动修改您的 OpenClaw 配置,将所有提供商路由至 ClawCap:
bash
node skills/clawcap/scripts/setup.js
该操作将:
- - 读取您的 ~/.openclaw/openclaw.json
- 将所有提供商的 baseUrl 指向您的 ClawCap 代理 URL
- 将原始配置备份至 ~/.openclaw/openclaw.json.backup
3. 完成 — 您已受到保护
正常启动 OpenClaw。所有请求现在都通过 ClawCap 流转,您的消费上限将自动生效。
随时查看消费情况:
bash
curl https://clawcap.co/proxy/$CLAWCAP_TOKEN/status
手动配置
如果您偏好手动配置,请在 ~/.openclaw/openclaw.json 中将每个提供商的 baseUrl 设置为:
https://clawcap.co/proxy/YOUR_TOKEN
您的 API 密钥保持不变 — ClawCap 仅读取它们以转发请求,绝不存储。
环境变量
| 变量 | 描述 |
|---|
| CLAWCAPTOKEN | 您的 ClawCap 代理令牌(以 cclive_ 开头) |
套餐方案
| 套餐 | 价格 | 功能 |
|---|
| 免费版 | $0 | 每日 $5 上限、紧急终止、心跳检测 |
| 个人版 |
$5/月 | 自定义上限、心跳+循环保护、Telegram 提醒 |
| 专业版 | $15/月 | 多智能体追踪、按模型分析、自定义提醒阈值、每周消费报告 |
故障排除
智能体未通过 ClawCap 路由: 检查 openclaw.json 中的 baseUrl 是否指向 https://clawcap.co/proxy/cclive... — 而非原始 API URL。
429 错误: 您已达到消费上限。查看 /status 了解当前消费情况,或升级套餐以获得更高限额。
令牌无效: 请确保使用的是设置页面中的完整 cclive... 令牌,而非仅邮箱地址。
相关链接