Optimizations: Overview
February 12, 2026 ยท View on GitHub
Table of contents (Explain OpenClaw)
- Home (README)
- Plain English
- Technical
- Privacy + safety
- Deployment
- Optimizations
- Reference
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:
- Reduce API costs - Use smarter routing, cheaper models for simple tasks
- Optimize token usage - Manage context windows, prune conversations efficiently
- Improve performance - Balance cost vs. latency for your use case
Quick Decision Matrix
| Goal | Strategy | Primary Resource |
|---|---|---|
| Minimize cost | OpenRouter auto routing with sort: price | Cost + token optimization |
| Minimize latency | Nitro variants or sort: throughput | Cost + token optimization |
| Balance both | Auto router with default settings | Cost + token optimization |
| Reduce tokens | Context pruning, efficient prompts | Cost + token optimization |
| Track spending | OpenRouter dashboard, budget alerts | Cost + token optimization |
| Zero cost | Free model routing | Cost + token optimization |
| Per-function optimization | Right-size models for each task | Model recommendations by function |
| Local models | Zero API cost with Docker/Ollama | Local models: zero API cost |
Available Guides
| Guide | Description |
|---|---|
| Resource usage analysis | CPU, memory, disk footprint for OpenClaw processes and dependencies |
| Cost + token optimization | OpenRouter integration, auto routing, provider configuration, token management |
/consult-codex dual-AI consultation | Codex 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:
- Model provider pricing - Claude Opus costs ~15x more per token than Haiku
- Conversation length - Long sessions accumulate context tokens
- Tool usage - Web fetch, search, and browser tools add tokens
- 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.