← 返回
未分类 中文

Token Economy

Reduce OpenClaw costs by 60-80% using cheap-first model routing, bounded context sizes, zero-token heartbeats, and token auditing with budget guardrails.
通过廉价优先模型路由、受限上下文大小、零令牌心跳以及带预算护栏的令牌审计,将OpenClaw成本降低60‑80%。
pfaria32
未分类 clawhub v1.0.3 1 版本 100000 Key: 无需
★ 0
Stars
📥 205
下载
💾 0
安装
1
版本
#budget#cost-optimization#efficiency#latest

概述

Token Economy

Reduce OpenClaw costs by 60-80% through intelligent model routing and context management. Cheap-first escalation (GPT-4o → Sonnet → Opus), zero-token heartbeats, and budget guardrails. Save $60-105/month per deployment.

When to use: Questions about costs, model routing, token optimization, budget

What to know:

Active Optimizations

This OpenClaw fork includes token-economy hooks (deployed Feb 13, 2026):

1. Model Routing - Cheap-first with escalation:

  • Start: GPT-4o (fast, cheap)
  • Escalate: Sonnet (balanced)
  • Last resort: Opus (expensive, complex tasks only)

2. Bounded Context - Hard caps prevent bloat:

  • Max bundle size: 10,000 tokens
  • Auto-truncate if exceeded
  • Prevents runaway context costs

3. Zero-Token Heartbeat - Pre-LLM check:

  • If HEARTBEAT.md empty → skip API call (100% cost elimination)
  • Heartbeats were ~50% of token usage before optimization

4. Token Auditing - Full transparency:

  • Log: ~/.openclaw/token-audit.jsonl
  • Daily reports available
  • Budget guardrails: $25/day hard cap

Expected Impact

  • 60-80% overall token reduction
  • 100% heartbeat cost elimination
  • ~$1-1.50/day (vs ~$3-5/day before)
  • $60-105/month savings

Config Location

~/.openclaw/openclaw.json - token-economy hooks configuration

Repository

https://github.com/pfaria32/open-claw-token-economy

Status Commands

# Check current model
openclaw status

# View token usage
cat ~/.openclaw/token-audit.jsonl | tail -20

# Check heartbeat config
cat ~/workspace/HEARTBEAT.md

When to Mention

  • User asks about costs or budget
  • Model selection questions
  • "Why is this slow/expensive?"
  • Optimization discussions
  • Before making model routing decisions

Auto-Switch to Sonnet

If model is set to Opus and there's no user input for >1 hour with no complex task in progress, automatically switch back to Sonnet to save costs. A cron job checks this every 30 minutes.

When to stay on Opus:

  • Active complex reasoning/debugging task
  • User explicitly requested Opus for a specific purpose
  • Working on something that genuinely needs the extra capability

版本历史

共 1 个版本

  • v1.0.3 当前
    2026-05-12 06:01 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

security-compliance

OpenClaw Shield

pfaria32
企业AI安全扫描器,采用静态分析、运行时防护与ClamAV,检测凭证窃取、数据泄露、恶意软件并确保审计日志。
★ 2 📥 4,258

Capability Awareness System

pfaria32
使 OpenClaw 代理能按需发现、识别并访问自定义技能文档,未激活时零开销。
★ 0 📥 357

OpenClaw Expansion Pack

pfaria32
企业级OpenClaw套件,具备安全扫描、60-80%令牌成本降低、自愈质量与持续改进的技能发现功能。
★ 0 📥 275