Hermes Agent Cost Tracking: Token Spend and Cache Rate From acp-hermes report
Just want the answer? Hermes already prices your calls. This plugin keeps the record and gives you a command to read it:
pip install acp-hermes && hermes plugins enable acp
# next session, then:
acp-hermes report
Full Hermes install guide → · get a workspace key → · local metering needs no account at all
Hermes Agent shows you what a call costs. It doesn’t keep a running record. You can’t ask it for last week’s cache hit rate, or which tool’s output is filling your context. acp-hermes fills that gap. It listens to the same request Hermes already prices and writes it to a file you can query.
This page covers what it records, what acp-hermes report prints, and what it leaves blank.
Where the numbers come from
The plugin registers four Hermes hooks. Two of them do the cost work.
| Hook | What it records |
|---|---|
post_api_request |
Each model request: the model, token counts (input, output, cache read, cache write, reasoning), and latency. Priced with Hermes’s own pricing engine. |
post_llm_call |
Where the prompt text came from on each turn: system, user, assistant, tool results. |
Both run inside Hermes, in the process that is already making the call. Nothing sits in front of the model API. That’s different from how cost tracking works for Claude Code and Codex CLI, which read usage numbers from the model traffic or the session transcript.
The other two hooks, pre_tool_call and post_tool_call, handle tool-call checks and audit. The tool table in the report also comes from post_tool_call.
Rows go to ~/.acp/hermes-local.db, a SQLite file on your machine. The metering side uploads nothing.
What the report shows
After a session, acp-hermes report prints the last 7 days:
ACP local report — last 7 days (this machine, ~/.acp/hermes-local.db)
MODEL SPEND
model calls in-tok out-tok cache
gemini-pro-latest 164 827K 5.2K 83%
CACHE hit rate 83% (4.1M of 5.0M prompt tokens read from cache)
CONTEXT COMPOSITION (share of prompt chars, all turns)
tool results 96% · system 0% · assistant 1% · user 3%
Tool results dominate your context — truncating or summarizing large
tool outputs is usually the cheapest big win.
TOOLS (top by calls)
tool calls errors avg ms output
terminal 160 0 1201 492KB
That sample comes from the agent that runs ACP’s own ops backlog. Each section answers one question.
- Model spend shows calls, input and output tokens, and cache share per model. When Hermes can price the route, the report also totals the dollars.
- Cache is the overall hit rate. At 83%, most of what the model reads each turn is billed at the cache rate. If the number drops from one session to the next, look into it before it shows up in the total.
- Context composition shows where the prompt text comes from. In a coding or research agent it’s usually tool results. Truncating or summarizing what a tool returns often saves more than switching to a smaller model.
- Tools shows calls, errors, average latency and output size per tool. A tool with big outputs is the next candidate for the same fix.
--days 30 widens the window. --json prints the same figures as data, so you can feed them back to the agent.
Unpriced routes stay unpriced
Hermes’s pricing engine knows its usual routes, including OpenRouter and Bedrock. If a call goes through a route it can’t price, the report marks it unpriced and says how many calls that was. It doesn’t make up a number. Token counts stay exact. For a local report that matters, because it’s often the only place the figure exists.
Turning it off or moving it
export ACP_LOCAL_METERING=off # turn local metering off
export ACP_LOCAL_DB=/path/to.db # move the database (default ~/.acp/hermes-local.db)
If acp-hermes report says there’s no metered activity, the plugin probably isn’t enabled. Run hermes plugins list. A session that started before you ran hermes plugins enable acp won’t pick the hooks up. Also check that ACP_LOCAL_METERING isn’t set to off.
What the cloud side adds
acp-hermes login is a separate, optional step. It connects the plugin to a workspace, so each tool call is checked against allow, ask and deny rules and logged across your machines. The report works the same with or without it, because pricing happens on your machine either way. Decide on login for the rules and the log, not for cost.
If ACP can’t be reached, the plugin lets the tool call go ahead and writes a warning. The call shows up in the console as having run ungoverned.
Budget limits
The report is a number after the fact. It doesn’t stop anything. ACP does have a spending budget in the console (Settings → Limits) that can halt tool calls at a cap, but it only counts model spend ACP can see. The Hermes metering stays on your machine, so this report doesn’t feed that cap. If a hard limit matters more than visibility, don’t count on this plugin for it.
Frequently asked questions
Does Hermes Agent track cost?
Hermes prices calls with its own pricing engine and shows you the numbers. What it doesn’t keep is a record across sessions: a running total, a breakdown by model or tool, a cache hit rate over the last week. The acp-hermes plugin keeps that record in a local database and gives you a report command to read it.
How does the plugin see cost without a proxy?
Hermes has a post_api_request hook that runs inside Hermes after every model request. It hands the plugin the model, the token counts (input, output, cache read, cache write, reasoning) and the latency. The plugin prices that with Hermes’s own pricing engine, so the dollar figures match what Hermes shows, and writes a row to a local SQLite file. Model traffic goes where it already went. Claude Code and Codex cost tracking work differently: they read usage numbers from the model traffic or the session transcript.
What's the difference between acp-hermes report and report --json?
Same data, different reader. report prints tables for a person. report --json prints the same figures as structured data, so you can hand them back to the agent and let it look at its own spend.
What happens when the plugin can't price a call?
It shows the call as unpriced instead of guessing. Hermes’s pricing engine covers its usual routes plus OpenRouter and Bedrock. An unusual proxy or self-hosted endpoint can fall outside that. Token counts stay exact even when there’s no dollar figure.
Where to read more
- Claude Code cost tracking reference: how cost tracking works for Claude Code, for comparison
- Codex CLI cost tracking: the same for Codex
- Hermes Agent install guide: the full plugin setup, including rules and audit
- Setting up an autonomous Hermes agent safely: the rules side of the same plugin, for unattended runs
Running Hermes? One command adds a hook. Each tool call it sees is recorded, and a force-push, destructive SQL or curl | sh is blocked until you approve it on the console or from the email.
curl -fsSL https://agenticcontrolplane.com/install.sh | bash
irm https://agenticcontrolplane.com/install.ps1 | iex
What the installer writes · Hermes guide · free up to 5 agents