How to Slash Your AI Agent Costs Without Sacrificing Quality

Opinion | 15 July 2026

I have been running Hermes Agent in my test labs as a personal AI assistant for months now, and I love what it can do.
A few weeks ago, I sat down to review what it was actually costing me in API tokens, and the number was higher than I expected.

The strange part was that most of the cost was not coming from the work I actively asked it to do. It was coming from background tasks I had set up and forgotten about, from default settings I had never touched, and from skills and tools sitting in the context window that I was not even using.

If you run Hermes Agent, or any AI assistant on a usage-based model, you have probably had the same experience. Here is what I changed to bring the cost down, and none of it required compromising on output quality.

Step 1: Know What Is Eating Your Tokens

Before you can cut costs, you need to know where the tokens are going. Hermes stores every bit of token usage data in a local database. You can ask it for a detailed breakdown at any time, going all the way back to when you first installed the agent. It will tell you how many sessions you have run, how many tokens each one consumed, and what it all cost.

The hermes insights command does the same thing in a more structured way. It gives you a 30-day cost breakdown, shows which tools and skills you use the most, and even reveals your longest sessions and activity patterns. Run that first. The answers will surprise you.

Step 2: Fix Your Model and Provider

The model you use drives most of your bill, and this is where the biggest savings live.

Hermes runs a lot of small background tasks: reading images, searching skills, loading MCP tools, writing profile descriptions. By default, those go through your main model. You can change this in your config.yaml by setting a separate, cheaper model for auxiliary tasks. These jobs do not need the heavy reasoning your main model is built for. A fast, inexpensive model handles them fine.

The same logic applies to sub-agents. Every sub-agent Hermes spawns runs in its own context window, so the token cost stacks up fast. You can set a cheaper model for sub-agents in the config and save every time one gets spun up.

If you use a provider like Open Router, consider enabling the Parto router which automatically sends each task to the right model for the job. Simple lookups go to the cheap tier. Complex reasoning goes to the expensive one. The router decides, and you do not waste tokens on overkill.

Step 3: Tame the Context Window

Your agent sends the entire conversation history, all your loaded skills, every active tool, and your memory files with every single message. That context window grows fast and is the second-biggest driver of cost.

The single most impactful habit you can build is using the compress command regularly. It starts a fresh session built on a concise summary of everything that has happened so far. The model keeps the context, but in a much leaner form. You save hundreds of tokens per message.

You can also adjust two settings in your config. The compression threshold controls how early Hermes triggers compression. The default is 50 per cent, which means it compresses only after half the context window is full. Lower it to 25 or 30 per cent and compression kicks in sooner, keeping the context lean through every conversation.

The target ratio determines how much uncompressed history carries over after compression. Set this lower to reduce the number of old messages sent with each turn.

There is also a setting that controls how much tool output enters the context. If you are on a usage-based billing model, bring that value down. The agent still gets the tool results it needs, but it does not drag in every byte of every response.

Step 4: Prune Your Tools, Skills, and MCP Servers

Every skill you have installed adds its name and description to the context window of every message. Hermes ships with around 90 pre-installed skills, and that number grows the longer you use it because the agent turns any reusable workflow into a new skill. You are almost certainly not using most of them.

Go through your skill list. Turn off every skill you do not need. The agent only loads the ones that are active, so a shorter list means a smaller context window and fewer input tokens on every message.

The same applies to your toolset. Hermes comes with more than 17 built-in tools. Run hermes list to see what is active. If you do not need code execution in a given profile (I do not in my daily driver profile), disable it. Disable anything else you are not actively using.

Every MCP server you connect also brings its own set of tools into the context. Disconnect any servers you are not using regularly.

For the servers you keep, make sure tool search is set to auto. This ensures tools are loaded only when actually needed, rather than sitting in the context window for every message.

Step 5: Set Hard Limits

By default, Hermes allows the agent up to 150 turns to complete a task. That means it can iterate 150 times, calling tools, reading outputs, and weighing results before it gives up. The problem is that when the agent gets confused, it can burn through all of those turns, re-sending the entire context while it tries to solve something it is stuck on.

Drop max turns to 60. The agent still completes complex tasks, but it wastes less time spinning on problems it cannot solve.

There is also a hard stop setting. Switch it from false to true. When the agent gets stuck and stops making progress, the hard stop kicks in and prevents it from looping endlessly.

Set a max token limit for output. This pushes the model to give tighter answers instead of rambling, and it saves directly on output token costs.

Step 6: Audit Your Cron Jobs

This was the big one for me. Scheduled cron jobs that run in the background have no limit on their max turns by default. A single run of one of these jobs costs very little, but when it runs every few minutes, or you have a dozen similar jobs running all day, the cost compounds rapidly.

Set a specific turn cap for every cron job. Even a modest limit of 20 to 30 turns per run stops background jobs from consuming tokens indefinitely.

Step 7: Make Smart Choices on Memory and Files

Hermes keeps memory files and agent files that sit in your context window the entire time. The smaller these files are, the fewer tokens go out with every message. Review what is in them and trim anything that is no longer relevant.

For one-off instructions, use ephemeral system prompts instead of writing them into permanent context files. They work for that single session and then disappear, taking zero space in subsequent conversations.

If you have a local knowledge base or second brain system, organise the data so the agent can load it bit by bit as needed rather than pulling in the entire file. That prevents wasted tokens on content it does not need for the current task.

The auto-memory feature is another trade-off. Switching it off stops the agent from constantly writing and updating memory, which saves tokens. But you lose one of the best features of Hermes: the ability to hold context about you across sessions. I keep it on because the value of persistent memory outweighs the cost, but it is worth knowing the trade-off exists.

The Bottom Line

The changes that saved me the most were setting a cheaper model for auxiliary tasks, dropping the max turns limit, pruning unused skills and tools, and capping cron job turns. None of these required me to accept worse output from the agent. They just stopped it from burning tokens on work it should not have been doing.

Run the insights command. Look at where your tokens are going. Then work through these steps one by one. The savings add up fast, and your agent will not miss a beat.

The most expensive token is the one you did not know you were spending.

Related Reading

Subscribe

Related articles

NVIDIA, Microsoft, Meta, and 50+ Companies Tell Washington Not to Lock Down Open AI

More than 50 tech companies including NVIDIA, Microsoft, Meta, and Google published a joint letter urging Washington to protect open-weight AI models. The only notable holdout? Anthropic. Here is what the fight is actually about.

Europe Just Drew a Red Line on AI and Cybersecurity. Here Is What It Means

The EU Action Plan on Cybersecurity and AI sets nine actions across three pillars, with enforcement starting 2 August 2026. Fines climb to 3% of global turnover or 15 million euros for non-compliance. Here is what every security leader needs to know.

Australia Sets Rules for AI. The Hard Part Comes Next.

Australian writers, musicians and journalists will keep ownership of...

FLUX 3: How Black Forest Labs Is Bridging Video AI and Real-World Robots

Black Forest Labs' FLUX 3 is expanding from video and image generation into robot control for Audi factories, with an open-weight model planned for factory hardware.

The Open Source AI Revolution: When the World’s Biggest Models Became Free

Chinese open-source AI models led by Moonshot Kimi K3 have functionally closed the gap with proprietary systems from OpenAI and Anthropic, with profound consequences for geopolitics, global markets, and the future of autonomous AI agents.