Optimizations: Overview

February 12, 2026 ยท View on GitHub

Table of contents (Explain OpenClaw)


What This Section Covers

Running a self-hosted AI assistant incurs costs from model API calls and can consume significant tokens. This section helps you:

  1. Reduce API costs - Use smarter routing, cheaper models for simple tasks
  2. Optimize token usage - Manage context windows, prune conversations efficiently
  3. Improve performance - Balance cost vs. latency for your use case

Quick Decision Matrix

GoalStrategyPrimary Resource
Minimize costOpenRouter auto routing with sort: priceCost + token optimization
Minimize latencyNitro variants or sort: throughputCost + token optimization
Balance bothAuto router with default settingsCost + token optimization
Reduce tokensContext pruning, efficient promptsCost + token optimization
Track spendingOpenRouter dashboard, budget alertsCost + token optimization
Zero costFree model routingCost + token optimization
Per-function optimizationRight-size models for each taskModel recommendations by function
Local modelsZero API cost with Docker/OllamaLocal models: zero API cost

Available Guides

GuideDescription
Resource usage analysisCPU, memory, disk footprint for OpenClaw processes and dependencies
Cost + token optimizationOpenRouter integration, auto routing, provider configuration, token management
/consult-codex dual-AI consultationCodex GPT-5.3 + Code-Searcher cross-verification used for analysis in this section

Why Optimization Matters

Self-hosted doesn't mean free. Your AI assistant's running costs depend on:

  1. Model provider pricing - Claude Opus costs ~15x more per token than Haiku
  2. Conversation length - Long sessions accumulate context tokens
  3. Tool usage - Web fetch, search, and browser tools add tokens
  4. Response verbosity - Longer replies cost more

Even modest usage (50 messages/day) can cost $50-500+/month depending on model choice. Proper optimization can reduce this by 50-80% without noticeable quality loss for most use cases.


Next: Cost + token optimization