
OpenClaw (formerly known as Moltbot) has captured the imagination of many. It can be quite expensive to run if you don’t optimize it. For starters, you need to make sure you don’t go with the default Heartbeat settings. This is a feature that runs tasks on a schedule. By default, it runs every 30 minutes, which could increase your costs. It is designed to run the agent to find things that are important. It is superior to cron jobs as it saves you from having to run multiple instances to keep up with everything. Instead of going with every 30 minutes, you can increase that to whatever you are comfortable with.

In your Heartbeat.md file, you can ask it to check your emails for messages, review calendar for events, and send a check in if ideal for over 8 hours. Another trick is to use multiple models, so instead of relying on the most expensive Claude model, you pick and choose which model should be used. OpenClaw reads instructions from its workspace directory /.openclaw/workspace. You can command the agent to only load soul, user, identity and other essential files. You can ask the agent to avoid loading memory, session history, and other data that could eat up your API costs.

Your openclaw.json file lets you define whitelisted phone number and information. You can also set default models here or in your system prompt. For most tasks, you can go with Haiku but for more expensive tasks, you can try other models. It is even possible to run your heartbeat through a free model on Ollama. With prompt caching, you can save further on your costs.

