Optimizing OpenClaw costs by extending system prompt cache duration from 5 minutes to 1 hour.

Deploy & Ops📅 2026/04/06
#API#Developer#LLM 经济#Low Risk#Mac mini#Manual Trigger#Reusable#Semi-Automatic#代码仓库#成本优化#日志#缓存策略
just found out something about openclaw.

by default it caches your system prompt every 5 minutes. fine for most people. but if you use it religiously like me, you can flip one config field and extend it to 1 hour.

i run 67 agents from a Mac mini all workers are cheap/local models and main brain opus of course. every message rebuilds 237k tokens of context. thats $3.56 per call on opus just to load the system prompt. before the model even reads your question.

the math on a 10 message session (bursts throughout the hour):

uncached = $35.60
5 min cache = ~$18.40 (rebuilds every coffee break)
1 hour cache = $10.36 (one rebuild, then 90% off all hour)

5 min saves you ~48%.
1 hour saves you ~70%.

same model. same context. same answers. one config flag.

most people running AI systems dont realise the API has levers like this. theyre just paying full price and wondering why their bill is melting.