LLM Gateway
sickn33/agentic-awesome-skills
Deploy an API gateway for LLM traffic with load balancing, rate limiting, key management, semantic caching, fallback routing, and cost tracking.
Reduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL…
$ npx skills add LeoYeAI/openclaw-master-skills --skill token-optimizer -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install LeoYeAI/openclaw-master-skills token-optimizer --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/LeoYeAI/openclaw-master-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/openclaw-token-optimizer .claude/skills/token-optimizer && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "token-optimizer" agent skill from https://github.com/LeoYeAI/openclaw-master-skills/tree/main/skills/openclaw-token-optimizer into .claude/skills/token-optimizer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "token-optimizer", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/LeoYeAI/openclaw-master-skills/tree/main/skills/openclaw-token-optimizerType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add LeoYeAI/openclaw-master-skills --skill token-optimizer -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install LeoYeAI/openclaw-master-skills token-optimizer --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/LeoYeAI/openclaw-master-skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/openclaw-token-optimizer .agents/skills/token-optimizer && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "token-optimizer" agent skill from https://github.com/LeoYeAI/openclaw-master-skills/tree/main/skills/openclaw-token-optimizer into .agents/skills/token-optimizer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "token-optimizer", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add LeoYeAI/openclaw-master-skills --skill token-optimizer -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install LeoYeAI/openclaw-master-skills token-optimizer --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/LeoYeAI/openclaw-master-skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/openclaw-token-optimizer .cursor/skills/token-optimizer && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "token-optimizer" agent skill from https://github.com/LeoYeAI/openclaw-master-skills/tree/main/skills/openclaw-token-optimizer into .cursor/skills/token-optimizer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "token-optimizer", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/LeoYeAI/openclaw-master-skills.git --path skills/openclaw-token-optimizer--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add LeoYeAI/openclaw-master-skills --skill token-optimizer -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install LeoYeAI/openclaw-master-skills token-optimizer --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/LeoYeAI/openclaw-master-skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/openclaw-token-optimizer .gemini/skills/token-optimizer && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "token-optimizer" agent skill from https://github.com/LeoYeAI/openclaw-master-skills/tree/main/skills/openclaw-token-optimizer into .gemini/skills/token-optimizer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "token-optimizer", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install LeoYeAI/openclaw-master-skills token-optimizerInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add LeoYeAI/openclaw-master-skills --skill token-optimizer -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/LeoYeAI/openclaw-master-skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/openclaw-token-optimizer .github/skills/token-optimizer && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "token-optimizer" agent skill from https://github.com/LeoYeAI/openclaw-master-skills/tree/main/skills/openclaw-token-optimizer into .github/skills/token-optimizer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "token-optimizer", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add LeoYeAI/openclaw-master-skills --skill token-optimizer -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install LeoYeAI/openclaw-master-skills token-optimizer --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/LeoYeAI/openclaw-master-skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/openclaw-token-optimizer .opencode/skills/token-optimizer && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "token-optimizer" agent skill from https://github.com/LeoYeAI/openclaw-master-skills/tree/main/skills/openclaw-token-optimizer into .opencode/skills/token-optimizer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "token-optimizer", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
token-optimizerReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL…
Token Optimizer is an agent skill from LeoYeAI/openclaw-master-skills. Reduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (contextoptimizer, modelrouter, heartbeatoptimizer, tokentracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md…
Its SKILL.md is about 5.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 11 other files, including scripts (for example `CHANGELOG.md`, `README.md` and `SECURITY.md`).
It sits in AI & LLM Engineering, covering Model routing and gateways, LLM cost and token optimization and Rate limiting. The repository describes itself as: 🧠 Curated collection of 1209+ best OpenClaw skills — weekly updated by MyClaw.ai. The licence is MIT.
7 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit e5199b5. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Ships 5 files in scripts/ (Python and Shell), which the agent can run.
Shell commands in SKILL.md call:
python3jqFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Token Optimizer loads about 5.2k tokens when it runs. Until then it costs about 177 tokens; SKILL.md has 1,434 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.
The full file from LeoYeAI/openclaw-master-skills at commit e5199b5, republished under its MIT licence (© LeoYeAI). 1,434 words, ~5,158 tokens.
.claude/skills/token-optimizer/SKILL.md (or your agent's skills folder). This skill also uses 10 other files; get the full folder from GitHub.Comprehensive toolkit for reducing token usage and API costs in OpenClaw deployments. Combines smart model routing, optimized heartbeat intervals, usage tracking, and multi-provider strategies.
Immediate actions (no config changes needed):
Generate optimized AGENTS.md (BIGGEST WIN!):
python3 scripts/context_optimizer.py generate-agents
# Creates AGENTS.md.optimized — review and replace your current AGENTS.mdCheck what context you ACTUALLY need:
python3 scripts/context_optimizer.py recommend "hi, how are you?"
# Shows: Only 2 files needed (not 50+!)Install optimized heartbeat:
cp assets/HEARTBEAT.template.md ~/.openclaw/workspace/HEARTBEAT.mdEnforce cheaper models for casual chat:
python3 scripts/model_router.py "thanks!"
# Single-provider Anthropic setup: Use Sonnet, not Opus
# Multi-provider setup (OpenRouter/Together): Use Haiku for max savingsCheck current token budget:
python3 scripts/token_tracker.py checkExpected savings: 50-80% reduction in token costs for typical workloads (context optimization is the biggest factor!).
The single highest-impact optimization available. Most agents burn 3,000–15,000 tokens per session loading skill files they never use. Stop that first.
The pattern:
SKILLS.md catalog in your workspace (~300 tokens — list of skills + when to load them)Token savings:
| Library size | Before (eager) | After (lazy) | Savings |
|---|---|---|---|
| 5 skills | ~3,000 tokens | ~600 tokens | 80% |
| 10 skills | ~6,500 tokens | ~750 tokens | 88% |
| 20 skills | ~13,000 tokens | ~900 tokens | 93% |
Quick implementation in AGENTS.md:
## Skills
At session start: Read SKILLS.md (the index only — ~300 tokens).
Load individual skill files ONLY when a task requires them.
Never load all skills upfront.Full implementation (with catalog template + optimizer script):
clawhub install openclaw-skill-lazy-loaderThe companion skill openclaw-skill-lazy-loader includes a SKILLS.md.template, an AGENTS.md.template lazy-loading section, and a context_optimizer.py CLI that recommends exactly which skills to load for any given task.
Lazy loading handles context loading costs. The remaining capabilities below handle runtime costs. Together they cover the full token lifecycle.
Biggest token saver — Only load files you actually need, not everything upfront.
Problem: Default OpenClaw loads ALL context files every session:
Solution: Lazy loading based on prompt complexity.
Usage:
python3 scripts/context_optimizer.py recommend "<user prompt>"Examples:
# Simple greeting → minimal context (2 files only!)
context_optimizer.py recommend "hi"
→ Load: SOUL.md, IDENTITY.md
→ Skip: Everything else
→ Savings: ~80% of context
# Standard work → selective loading
context_optimizer.py recommend "write a function"
→ Load: SOUL.md, IDENTITY.md, memory/TODAY.md
→ Skip: docs, old memory, knowledge base
→ Savings: ~50% of context
# Complex task → full context
context_optimizer.py recommend "analyze our entire architecture"
→ Load: SOUL.md, IDENTITY.md, MEMORY.md, memory/TODAY+YESTERDAY.md
→ Conditionally load: Relevant docs only
→ Savings: ~30% of contextOutput format:
{
"complexity": "simple",
"context_level": "minimal",
"recommended_files": ["SOUL.md", "IDENTITY.md"],
"file_count": 2,
"savings_percent": 80,
"skip_patterns": ["docs/**/*.md", "memory/20*.md"]
}Integration pattern: Before loading context for a new session:
from context_optimizer import recommend_context_bundle
user_prompt = "thanks for your help"
recommendation = recommend_context_bundle(user_prompt)
if recommendation["context_level"] == "minimal":
# Load only SOUL.md + IDENTITY.md
# Skip everything else
# Save ~80% tokens!Generate optimized AGENTS.md:
context_optimizer.py generate-agents
# Creates AGENTS.md.optimized with lazy loading instructions
# Review and replace your current AGENTS.mdExpected savings: 50-80% reduction in context tokens.
Automatically classify tasks and route to appropriate model tiers.
NEW: Communication pattern enforcement — Never waste Opus tokens on "hi" or "thanks"!
Usage:
python3 scripts/model_router.py "<user prompt>" [current_model] [force_tier]Examples:
# Communication (NEW!) → ALWAYS Haiku
python3 scripts/model_router.py "thanks!"
python3 scripts/model_router.py "hi"
python3 scripts/model_router.py "ok got it"
→ Enforced: Haiku (NEVER Sonnet/Opus for casual chat)
# Simple task → suggests Haiku
python3 scripts/model_router.py "read the log file"
# Medium task → suggests Sonnet
python3 scripts/model_router.py "write a function to parse JSON"
# Complex task → suggests Opus
python3 scripts/model_router.py "design a microservices architecture"Patterns enforced to Haiku (NEVER Sonnet/Opus):
Communication:
Background tasks:
Integration pattern:
from model_router import route_task
user_prompt = "show me the config"
routing = route_task(user_prompt)
if routing["should_switch"]:
# Use routing["recommended_model"]
# Save routing["cost_savings_percent"]Customization:
Edit ROUTING_RULES or COMMUNICATION_PATTERNS in scripts/model_router.py to adjust patterns and keywords.
Reduce API calls from heartbeat polling with smart interval tracking:
Setup:
# Copy template to workspace
cp assets/HEARTBEAT.template.md ~/.openclaw/workspace/HEARTBEAT.md
# Plan which checks should run
python3 scripts/heartbeat_optimizer.py planCommands:
# Check if specific type should run now
heartbeat_optimizer.py check email
heartbeat_optimizer.py check calendar
# Record that a check was performed
heartbeat_optimizer.py record email
# Update check interval (seconds)
heartbeat_optimizer.py interval email 7200 # 2 hours
# Reset state
heartbeat_optimizer.py resetHow it works:
HEARTBEAT_OK when nothing needs attention (saves tokens)Default intervals:
Integration in HEARTBEAT.md:
## Email Check
Run only if: `heartbeat_optimizer.py check email` → `should_check: true`
After checking: `heartbeat_optimizer.py record email`Expected savings: 50% reduction in heartbeat API calls.
Model enforcement: Heartbeat should ALWAYS use Haiku — see updated HEARTBEAT.template.md for model override instructions.
Problem: Cronjobs often default to expensive models (Sonnet/Opus) even for routine tasks.
Solution: Always specify Haiku for 90% of scheduled tasks.
See: assets/cronjob-model-guide.md for comprehensive guide with examples.
Quick reference:
| Task Type | Model | Example |
|---|---|---|
| Monitoring/alerts | Haiku | Check server health, disk space |
| Data parsing | Haiku | Extract CSV/JSON/logs |
| Reminders | Haiku | Daily standup, backup reminders |
| Simple reports | Haiku | Status summaries |
| Content generation | Sonnet | Blog summaries (quality matters) |
| Deep analysis | Sonnet | Weekly insights |
| Complex reasoning | Never use Opus for cronjobs |
Example (good):
# Parse daily logs with Haiku
cron add --schedule "0 2 * * *" \
--payload '{
"kind":"agentTurn",
"message":"Parse yesterday error logs and summarize",
"model":"anthropic/claude-haiku-4"
}' \
--sessionTarget isolatedExample (bad):
# ❌ Using Opus for simple check (60x more expensive!)
cron add --schedule "*/15 * * * *" \
--payload '{
"kind":"agentTurn",
"message":"Check email",
"model":"anthropic/claude-opus-4"
}' \
--sessionTarget isolatedSavings: Using Haiku instead of Opus for 10 daily cronjobs = $17.70/month saved per agent.
Integration with model_router:
# Test if your cronjob should use Haiku
model_router.py "parse daily error logs"
# → Output: Haiku (background task pattern detected)Monitor usage and alert when approaching limits:
Setup:
# Check current daily usage
python3 scripts/token_tracker.py check
# Get model suggestions
python3 scripts/token_tracker.py suggest general
# Reset daily tracking
python3 scripts/token_tracker.py resetOutput format:
{
"date": "2026-02-06",
"cost": 2.50,
"tokens": 50000,
"limit": 5.00,
"percent_used": 50,
"status": "ok",
"alert": null
}Status levels:
ok: Below 80% of daily limitwarning: 80-99% of daily limitexceeded: Over daily limitIntegration pattern: Before starting expensive operations, check budget:
import json
import subprocess
result = subprocess.run(
["python3", "scripts/token_tracker.py", "check"],
capture_output=True, text=True
)
budget = json.loads(result.stdout)
if budget["status"] == "exceeded":
# Switch to cheaper model or defer non-urgent work
use_model = "anthropic/claude-haiku-4"
elif budget["status"] == "warning":
# Use balanced model
use_model = "anthropic/claude-sonnet-4-5"Customization:
Edit daily_limit_usd and warn_threshold parameters in function calls.
See references/PROVIDERS.md for comprehensive guide on:
Quick reference:
| Provider | Model | Cost/MTok | Use Case |
|---|---|---|---|
| Anthropic | Haiku 4 | $0.25 | Simple tasks |
| Anthropic | Sonnet 4.5 | $3.00 | Balanced default |
| Anthropic | Opus 4 | $15.00 | Complex reasoning |
| OpenRouter | Gemini 2.5 Flash | $0.075 | Bulk operations |
| Google AI | Gemini 2.0 Flash Exp | FREE | Dev/testing |
| Together | Llama 3.3 70B | $0.18 | Open alternative |
See assets/config-patches.json for advanced optimizations:
Implemented by this skill:
Native OpenClaw 2026.2.15 — apply directly:
contextPruning: cache-ttl) — auto-trims old tool results after Anthropic cache TTL expiresbootstrapMaxChars / bootstrapTotalMaxChars) — caps workspace file injection sizecacheRetention: "long" for Opus) — amortizes cache write costsRequires OpenClaw core support:
context_optimizer.py script today)Apply config patches:
# Example: Enable multi-provider fallback
gateway config.patch --patch '{"providers": [...]}'OpenClaw 2026.2.15 added built-in commands that complement this skill's Python scripts. Use these first for quick diagnostics before reaching for the scripts.
/context list → token count per injected file (shows exactly what's eating your prompt)
/context detail → full breakdown including tools, skills, and system prompt sectionsUse before applying bootstrap_size_limits — see which files are oversized, then set bootstrapMaxChars accordingly.
/usage tokens → append token count to every reply
/usage full → append tokens + cost estimate to every reply
/usage cost → show cumulative cost summary from session logs
/usage off → disable usage footerCombine with token_tracker.py — /usage cost gives session totals; token_tracker.py tracks daily budget.
/status → model, context %, last response tokens, estimated costThe problem: Anthropic charges ~3.75x more for cache writes than cache reads. If your agent goes idle and the 1h cache TTL expires, the next request re-writes the entire prompt cache — expensive.
The fix: Set heartbeat interval to 55min (just under the 1h TTL). The heartbeat keeps the cache warm, so every subsequent request pays cache-read rates instead.
# Get optimal interval for your cache TTL
python3 scripts/heartbeat_optimizer.py cache-ttl
# → recommended_interval: 55min (3300s)
# → explanation: keeps 1h Anthropic cache warm
# Custom TTL (e.g., if you've configured 2h cache)
python3 scripts/heartbeat_optimizer.py cache-ttl 7200
# → recommended_interval: 115minApply to your OpenClaw config:
{
"agents": {
"defaults": {
"heartbeat": {
"every": "55m"
}
}
}
}Who benefits: Anthropic API key users only. OAuth profiles already default to 1h heartbeat (OpenClaw smart default). API key profiles default to 30min — bumping to 55min is both cheaper (fewer calls) and cache-warm.
HEARTBEAT.mdExpected savings: 20-30%
Expected savings: 40-60%
Expected savings: 70-90%
# 1. User sends message
user_msg="debug this error in the logs"
# 2. Route to appropriate model
routing=$(python3 scripts/model_router.py "$user_msg")
model=$(echo $routing | jq -r .recommended_model)
# 3. Check budget before proceeding
budget=$(python3 scripts/token_tracker.py check)
status=$(echo $budget | jq -r .status)
if [ "$status" = "exceeded" ]; then
# Use cheapest model regardless of routing
model="anthropic/claude-haiku-4"
fi
# 4. Process with selected model
# (OpenClaw handles this via config or override)## HEARTBEAT.md
# Plan what to check
result=$(python3 scripts/heartbeat_optimizer.py plan)
should_run=$(echo $result | jq -r .should_run)
if [ "$should_run" = "false" ]; then
echo "HEARTBEAT_OK"
exit 0
fi
# Run only planned checks
planned=$(echo $result | jq -r '.planned[].type')
for check in $planned; do
case $check in
email) check_email ;;
calendar) check_calendar ;;
esac
python3 scripts/heartbeat_optimizer.py record $check
doneIssue: Scripts fail with "module not found"
Issue: State files not persisting
~/.openclaw/workspace/memory/ directory exists and is writable.Issue: Budget tracking shows $0.00
token_tracker.py needs integration with OpenClaw's session_status tool. Currently tracks manually recorded usage.Issue: Routing suggests wrong model tier
ROUTING_RULES in model_router.py for your specific patterns.Daily:
token_tracker.py checkWeekly:
Monthly:
PROVIDERS.md with new optionsExample: 100K tokens/day workload
Without skill:
| Strategy | Context | Model | Daily Cost | Monthly | Savings |
|---|---|---|---|---|---|
| Baseline (no optimization) | 50K | Sonnet | $0.30 | $9.00 | 0% |
| Context opt only | 10K (-80%) | Sonnet | $0.18 | $5.40 | 40% |
| Model routing only | 50K | Mixed | $0.18 | $5.40 | 40% |
| Both (this skill) | 10K | Mixed | $0.09 | $2.70 | 70% |
| Aggressive + Gemini | 10K | Gemini | $0.03 | $0.90 | 90% |
Key insight: Context optimization (50K → 10K tokens) saves MORE than model routing!
xCloud hosting scenario (100 customers, 50K tokens/customer/day):
context_optimizer.py — Context loading optimization and lazy loading (NEW!)model_router.py — Task classification, model suggestions, and communication enforcement (ENHANCED!)heartbeat_optimizer.py — Interval management and check schedulingtoken_tracker.py — Budget monitoring and alertsPROVIDERS.md — Alternative AI providers, pricing, and routing strategiesHEARTBEAT.template.md — Drop-in optimized heartbeat template with Haiku enforcement (ENHANCED!)cronjob-model-guide.md — Complete guide for choosing models in cronjobs (NEW!)config-patches.json — Advanced configuration examplesIdeas for extending this skill:
© LeoYeAI, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 10 other files (scripts) in skills/openclaw-token-optimizer of LeoYeAI/openclaw-master-skills.
Open the folder on GitHubat commit e5199b5
Token Optimizer next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Token Optimizer this skillLeoYeAI/openclaw-master-skills | 2.2k | — | ~5.2k | Automated safety check: Pass | MIT | |
| LLM Gatewaysickn33/agentic-awesome-skills | 47k | 1 repos | ~2.1k | Automated safety check: Pass | MIT | |
| Cost TrackingHabitat-Thinking/ai-literacy-superpowers | 114 | — | ~1.7k | Automated safety check: Pass | Custom licence | |
| Agents WorkflowsVectorSpaceLab/AREX-Skill | 328 | — | ~500 | Automated safety check: Pass | Apache-2.0 | |
| Cost Aware LLM Pipelinemajiayu000/claude-skill-registry | 666 | 6 repos | ~1.4k | Automated safety check: Pass | MIT | |
| LLM Routercuriositech/some_claude_skills | 243 | 1 repos | ~1.7k | Automated safety check: Pass | MIT |
sickn33/agentic-awesome-skills
Deploy an API gateway for LLM traffic with load balancing, rate limiting, key management, semantic caching, fallback routing, and cost tracking.
Habitat-Thinking/ai-literacy-superpowers
A skill your agent uses when the user wants to capture AI tool costs, review spending trends, set cost budgets, or integrate cost data into health snapshots — guides quarterly cost capture, records…
VectorSpaceLab/AREX-Skill
A skill your agent uses for giskard.agents async chat workflows, tools, prompt templates, structured outputs, retries, rate limiting, embeddings, and optional LiteLLM backend.
majiayu000/claude-skill-registry
Cost optimization patterns for LLM API usage — model routing by task complexity, budget tracking, retry logic, and prompt caching.
curiositech/some_claude_skills
Selects the optimal LLM model and provider for each task based on complexity, cost budget, and capability requirements.
mvanhorn/printing-press-library
Every Groq endpoint in your terminal, plus a local ledger that tracks token cost and rate-limit budget.
LeoYeAI/openclaw-master-skills
Manages pipelines on a DevOps quality and efficiency platform through its OpenAPI: list workspaces and templates, create, update, run and cancel pipelines, and read run records.
LeoYeAI/openclaw-master-skills
Patches OpenClaw's Feishu extension so an edited document triggers an isolated agent session that reads the doc and replies inline, turning it into a live chat space.
LeoYeAI/openclaw-master-skills
Multi-context memory management system for OpenClaw agents with group-isolated storage, global shared memory, workspace organization, and group-specific skills isolation.
LeoYeAI/openclaw-master-skills
Runs a brand's AI-search visibility work end to end: diagnosing how AI platforms represent it, repositioning it, producing AI-optimized content and monitoring ongoing mentions.
LeoYeAI/openclaw-master-skills
Installs and authenticates the gws CLI, then automates Gmail, Drive, Sheets, Calendar, Docs, Chat and Tasks with ready-made recipes, persona bundles and security audits.
LeoYeAI/openclaw-master-skills
Runs four advisor roles, a fitness coach, nutritionist, data analyst and TCM practitioner, to build a health profile and track workouts, diet and wellness over time.
Categories
Reduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL…. Token Optimizer is an agent skill from LeoYeAI/openclaw-master-skills.15 features (session pruning, bootstrap size limits, cache TTL alignment).
Token Optimizer fits situations like: token costs are high; API rate limits are being hit; hosting multiple agents at scale.
Run `npx skills add LeoYeAI/openclaw-master-skills --skill token-optimizer -a claude-code`. Or copy the skill folder (skills/openclaw-token-optimizer in LeoYeAI/openclaw-master-skills) into .claude/skills/token-optimizer in your project. Claude Code loads it when a task matches its description.
Run `npx skills add LeoYeAI/openclaw-master-skills --skill token-optimizer -a codex`. Or copy the skill folder (skills/openclaw-token-optimizer in LeoYeAI/openclaw-master-skills) into .agents/skills/token-optimizer in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add LeoYeAI/openclaw-master-skills --skill token-optimizer -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/token-optimizer, .gemini/skills/token-optimizer, .github/skills/token-optimizer and .opencode/skills/token-optimizer in your project.
Going by SKILL.md and its folder, Token Optimizer needs Python and a shell for the scripts in its folder and the command-line tools its instructions call (python3 and jq). Our summary lists: Python 3; A Bash shell.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.
Token Optimizer is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 5.2k tokens (SKILL.md is roughly 21k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Token Optimizer: LLM Gateway (sickn33/agentic-awesome-skills, 47k stars), Cost Tracking (Habitat-Thinking/ai-literacy-superpowers, 114 stars), Agents Workflows (VectorSpaceLab/AREX-Skill, 328 stars) and Cost Aware LLM Pipeline (majiayu000/claude-skill-registry, 666 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
LeoYeAI (a GitHub user) maintains it in LeoYeAI/openclaw-master-skills, which has 2,158 GitHub stars. The repository holds 1,215 skills in this directory. The repository was last updated on July 20, 2026.
Source: LeoYeAI/openclaw-master-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.