How to Reduce Token Usage on OpenClaw Hong Kong Server

To reduce token usage right away, separate your conversations and store important details in memory or external files instead of keeping everything in chat. Use the /compact command to clean up your sessions. For immediate impact, try these configuration tweaks, including enabling Hong Kong hosting where appropriate.
- Delete old Chrome SingletonLock files before you start the browser.
- Restore a working configuration file after startup.
- Set shared memory size to 2gb for Chromium in Docker.
- Add SYS_ADMIN capability so Chromium’s sandboxing works.
- Turn off seccomp filtering for smoother browser launches.
These steps help you control token use and keep your system efficient.
Key Takeaways
- Separate conversations into smaller sessions to reduce token usage. This keeps your interactions efficient and fast.
- Use the /compact command regularly to clean up chat history. This action helps lower token costs immediately.
- Trim tool outputs to include only essential information. Shorter outputs save tokens and improve workflow efficiency.
- Monitor your token usage daily to catch any unexpected spikes. Regular checks help you maintain control over costs.
- Choose smaller models for simple tasks. This strategy reduces token consumption without sacrificing quality.
Causes of High Token Usage
Settings That Increase Tokens
You can easily overlook settings that lead to high token consumption. Some common settings and practices include:
- Storing long conversations in a single session. This practice forces the system to process more data each time.
- Writing skill descriptions in a verbose style. Short, clear descriptions help reduce token use.
- Keeping the SOUL.md file under 500 words. This step helps you lower token consumption during interactions.
- Using bullet points and structured sections instead of long paragraphs. The AI processes information more efficiently in this format.
Tip: Review your configuration files regularly. Small changes, like trimming descriptions or splitting files, can make a big difference.
Usage Patterns Affecting Token Consumption
Your daily habits also affect high token consumption. If you keep adding to one conversation, the system must process all previous messages every time. This pattern quickly increases token use. Large tool outputs and frequent background polling can also drive up costs. Some users have reported spending $20 per day on API calls because of background polling. You should monitor your usage and adjust your workflow to avoid these spikes.
Features With High Token Impact
Some features on the OpenClaw Hong Kong Server have a much bigger effect on openclaw token usage than others. The table below compares features with high and low impact:
| Feature | High Impact | Low Impact |
|---|---|---|
| Long, continuous conversations | ✅ | |
| Verbose skill descriptions | ✅ | |
| Large tool outputs | ✅ | |
| Short, structured SOUL.md files | ✅ | |
| Bullet-point skill descriptions | ✅ | |
| Occasional background polling | ✅ |
You should focus on these high-impact areas to control high token consumption and keep your system efficient.
Reduce Token Usage: Practical Steps
Separate Conversations and Store Info
You can reduce token usage by splitting your conversations into smaller, focused sessions. When you keep each discussion short, the system does not have to process old messages every time. Save important details in memory files or external documents. This way, you avoid repeating information and keep your sessions clean. You will notice that your interactions become faster and more efficient.
Tip: Create a habit of ending a session when you finish a topic. Start a new one for each new subject. This practice helps you manage your data and reduce token usage.
Use /compact Command for Sessions
The /compact command helps you clean up your chat history. When you use this command, you remove unnecessary messages and keep only what matters. This action makes your sessions lighter and easier to process. You should run /compact after long conversations or before starting a new task. You will see a drop in token usage right away.
Trim Tool Outputs in Workflows
Large tool outputs can quickly increase your token usage. You should always trim outputs to include only the most relevant information. A well-trimmed context usually uses 2,000-3,000 tokens. If you do not trim, the context can reach 8,000-10,000 tokens, which raises your costs. Here are some ways to keep your workflows efficient:
- Keep files concise and focused on the task.
- Remove extra details that do not help your goal.
- Regularly review and update your memory files.
When you follow these steps, you reduce token usage and keep your system running smoothly.
Adjust imageMaxDimensionPx for Screenshots
Screenshots can use a lot of tokens if the images are too large. You can adjust the imageMaxDimensionPx setting to control the size of screenshots. Set this value to a lower number to shrink images before sending them. Smaller images use fewer tokens and help you reduce token usage. Check your configuration file and update this setting for better results.
Keep Skill Descriptions Concise
Long skill descriptions add extra tokens to every interaction. You should write short, clear descriptions for each skill. Use bullet points or short sentences. Avoid long paragraphs. When you keep descriptions concise, you reduce token usage and make your skills easier to understand.
Prefer Smaller Models for Exploratory Tasks
You do not need the largest model for every task. For simple or exploratory work, choose a smaller model like gpt-4o-mini. Smaller models use fewer tokens and cost less. You can switch to a larger model only when you need more power. This strategy helps you reduce token usage without losing quality.
Example Configurations
You can use proven configuration methods to reduce token usage. The table below shows some effective options:
| Configuration Method | Effect on Token Usage |
|---|---|
| Disable background tasks | Reduces token consumption by 60-80% |
| Use budget-friendly task model (gpt-4o-mini) | Cuts background task costs by 90% |
| Monitor conversation length | Prevents excessive token usage |
Try these configurations to see immediate improvements. You will notice that your system becomes more efficient and your costs go down.
Optimization and Verification
Monitor Token Metrics
You need to track your token usage to make sure your optimization efforts work. The OpenClaw Hong Kong Server gives you several tools and metrics for this purpose. You can use the dashboard to see live metrics through WebSocket. This dashboard shows your balance chart and activity distribution. You can also check survival days to see how long your agent stays solvent. The final balance tells you your net economic result. Total work income shows your gross earnings from tasks. Profit margin helps you understand your profit compared to your costs. Work quality gives you an average score for your tasks. Token efficiency tells you how much income you earn for every dollar spent on tokens. Activity mix shows the percentage of work versus learning decisions. Task completion rate measures how many tasks you finish compared to those assigned. Cost tracking records the token cost for each task.
| Tool/Metric | Description |
|---|---|
| Dashboard | Live metrics via WebSocket, including balance chart |
| Survival days | Duration the agent remains solvent |
| Final balance | Net economic result |
| Total work income | Gross earnings from tasks |
| Profit margin | Profit relative to costs |
| Work quality | Average quality score across tasks |
| Token efficiency | Income per dollar spent on tokens |
| Activity mix | Work vs. learning decisions |
| Task completion rate | Tasks completed vs. assigned |
| Cost Tracking | Token costs per task |
Tip: Check these metrics daily to spot trends and guide your optimization.
Compare Token Usage Before and After
You should always compare your token usage before and after making any optimization changes. Start by recording your baseline metrics. After you apply new settings or workflow changes, review the same metrics again. Look for drops in token costs, higher token efficiency, and better profit margins. If you see improvement, your optimization works. If not, adjust your approach and try again. This process helps you fine-tune your optimization strategy.
Set Alerts for Token Spikes
Token spikes can undo your optimization work. Set up alerts to warn you when token usage jumps above normal levels. Many dashboards let you create custom alerts for cost tracking and token efficiency. When you get an alert, check your recent changes or workflows. Fix any issues right away to keep your optimization on track. Regular alerts help you catch problems early and protect your progress.
Note: Consistent monitoring and quick action are key to successful optimization.
Common Pitfalls in Token Optimization
Hidden Token Drains
You may think you have optimized your system, but hidden token drains can still increase your consumption. Many users overlook background api calls that run without notice. These calls can add to your total consumption every day. You should check all scripts and integrations for unnecessary background api calls. Sometimes, tools or plugins send extra requests that you do not see. Each request increases your consumption. If you ignore these hidden drains, your cost will rise quickly. You should review your token consumption data often. Look for patterns that do not match your expected usage. If you find a spike, investigate all sources. You may find that a small script or tool causes a large increase in consumption.
Tip: Set up a daily review of your token consumption data. This habit helps you catch hidden drains before they become a big problem.
Misconfigurations
Misconfigurations can lead to high consumption and wasted resources. If you set the wrong model or forget to limit conversation length, your consumption will increase. You should always double-check your configuration files. Make sure you use smaller models for simple tasks. Check that you have set limits on conversation history. If you leave settings at default, you may pay a higher cost for every interaction. You should also check your image settings. Large images can add to your consumption without giving you better results. Review your skill descriptions and trim any extra words. Each word adds to your total consumption.
- Common misconfigurations that increase consumption:
- Using the largest model for all tasks
- Not setting a limit on conversation length
- Allowing large tool outputs
- Forgetting to trim skill descriptions
Neglecting Regular Monitoring
You need to monitor your consumption to keep it under control. If you do not check your token consumption data, you may miss warning signs. Many users forget to review their metrics after making changes. This mistake can lead to higher cost and lower efficiency. You should set reminders to check your dashboard every day. Track your consumption and compare it to your goals. If you see a sudden increase, act quickly. Regular monitoring helps you spot problems early. You can adjust your workflow and reduce your cost before it gets out of hand.
Note: Consistent monitoring is the best way to keep your consumption low and your system efficient.
| Pitfall | Impact on Consumption | How to Avoid |
|---|---|---|
| Hidden token drains | High | Review scripts and plugins |
| Misconfigurations | High | Double-check settings |
| No regular monitoring | High | Check metrics daily |
You can lower token usage by separating conversations, using the /compact command, trimming tool outputs, and optimizing your settings.
- Start new sessions for each topic.
- Clean up chat history often.
- Keep outputs short and clear.
- Choose smaller models for simple tasks.
Regular monitoring helps you spot problems early. Track your improvements and adjust your workflow for best results.
FAQ
What is the fastest way to reduce token usage on openclaw?
You can quickly lower token usage on openclaw by splitting conversations and saving important details in files. Use the /compact command often. This method keeps your sessions short and helps you avoid high token costs.
How do I know if my openclaw settings use too many tokens?
Check your openclaw dashboard for token metrics. Look for high token counts in long conversations or large tool outputs. If you see spikes, review your settings. Use the optimization guide to adjust your workflow and lower token use.
Why does background polling increase token costs on openclaw?
Background polling sends repeated requests. Each request uses tokens. If you do not limit polling, your openclaw system will use more tokens every day. Set polling intervals carefully. This cost control tip helps you avoid waste.
Can I use smaller models on openclaw to save tokens?
Yes, you can select smaller models for simple tasks on openclaw. Smaller models use fewer tokens. Switch to a larger model only when you need more power. This choice helps you manage token costs and improve efficiency.
What should I do if I see a sudden spike in token usage on openclaw?
First, check your recent changes or new workflows. Review your openclaw scripts for hidden token drains. Use the dashboard to track token activity. Fix any issues right away. Regular monitoring helps you keep token usage under control.
