token-optimizer

Optimize OpenClaw token costs via model routing, heartbeats, caching, and budgets.

8|4|Updated Feb 4, 2026
One-click install
npx skills add https://github.com/smartpeopleconnected/openclaw-token-optimizer --skill token-optimizer-smartpeopleconnected
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: token-optimizer
Source: https://github.com/smartpeopleconnected/openclaw-token-optimizer/tree/main
Command: npx skills add https://github.com/smartpeopleconnected/openclaw-token-optimizer --skill token-optimizer-smartpeopleconnected

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

OpenClaw defaults prioritize capability over cost, leading to expensive token usage. This Skill optimizes model routing, heartbeats, caching, and budgets to dramatically cut OpenClaw expenses.

Core Features & Use Cases

  • Model routing: Haiku by default with cheaper alternatives for tasks that require higher capability.
  • Multi-provider heartbeats: Route heartbeats via Ollama or other local options to avoid paid API costs.
  • Prompt caching: Reuse prompts for repeated content to reduce token consumption.
  • Budget controls: Enforce daily/monthly budgets and rate limits to prevent runaway costs.
  • Quick health checks and rollback: Health checks and configuration rollback for safer operations.

Quick Start

Run the optimizer to apply model routing, heartbeats, caching, and rate-limits with a dry-run preview.

Frequently Asked Questions about token-optimizer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce OpenClaw token costs with model routing?

OpenClaw token costs are reduced by routing tasks to Haiku by default and reserving expensive models for complex operations. The optimizer automatically applies this routing logic along with heartbeats, caching, and budget controls to minimize expenses.

Can I use Ollama for OpenClaw heartbeats to avoid paid API costs?

Yes, OpenClaw heartbeats can be routed via Ollama or other local options to avoid paid API costs. The optimizer configures multi-provider heartbeats to ensure operational checks do not consume paid model tokens.

How do I set up daily or monthly budgets and rate limits in OpenClaw?

Budget controls in OpenClaw are established by enforcing daily and monthly budgets with rate limits to prevent runaway costs. The optimizer applies these controls alongside caching and routing configurations to cap token usage.

What is the best way to preview OpenClaw cost optimization changes before applying?

The best way to preview OpenClaw cost optimization changes is using a dry-run. The optimizer provides a dry-run preview to review model routing, heartbeat, caching, and rate-limit configurations before committing them to your deployment.

Does prompt caching help reduce token consumption for repeated OpenClaw tasks?

Prompt caching reduces token consumption by reusing prompts for repeated content within OpenClaw. The optimizer implements this caching mechanism to lower token usage during real-world deployments and routine operations.