# Prime Agent Cost Tracking: See What a Long Run Costs

Prime Agent has no built-in cost tracking. To see what each model call costs, launch it with prime-acp, which sends its model calls through the ACP proxy. What you get, and how it relates to the tool-call extension.

<div class="acp-shot-frame">
<img src="/assets/img/screenshots/session-trace-dark.png" alt="An ACP session trace: each model call priced with its token and cached-token counts, interleaved with the tool calls it drove. The cost X-ray for one run." style="width:100%;height:auto;border:1px solid var(--line-2);border-radius:10px;box-shadow:0 20px 50px -24px rgba(0,0,0,0.9);margin:8px 0;" />
</div>

<div style="margin:8px 0 28px;padding:20px 22px;border:1px solid var(--line-2);border-radius:12px;background:var(--color-accent-light,#f0effe);">
  <p style="margin:0 0 12px;font-size:15px;line-height:1.6;color:var(--acp-text);"><strong>Just want the answer?</strong> Prime Agent has no cost tracking. Install ACP, then start it with <code>prime-acp</code> instead of <code>prime</code>:</p>
  <pre data-track="PrimeAgentCost: Hero Config Copy" style="margin:0 0 12px;background:var(--color-surface,#faf9ff);border:1px solid var(--line-2);border-radius:8px;padding:12px 14px;overflow-x:auto;"><code>curl -sf https://agenticcontrolplane.com/install.sh | bash
prime-acp</code></pre>
  <p style="margin:0;font-size:13px;color:var(--acp-text-dim);"><a href="/integrations/prime-agent" data-track="PrimeAgentCost: Integration Guide" style="font-weight:600;">Full Prime Agent install guide →</a> &nbsp;·&nbsp; <a href="/controls/prime-agent" data-track="PrimeAgentCost: Controls Reference">Prime Agent's control model, explained →</a> &nbsp;·&nbsp; free up to 5 agents</p>
</div>

Prime Agent ([PrimeIntellect-ai/prime-agent](https://github.com/PrimeIntellect-ai/prime-agent)) is a hard fork of [pi](/blog/pi-cost-tracking). It has one model-facing tool, a persistent `ipython` kernel, and it runs in daemon-backed sessions built for long, unattended work. It also has no permission framework and no cost tracking. The [control-model reference](/controls/prime-agent) covers the first gap. This post covers the second.

## Why the extension can't see cost

Prime Agent's two typed extension events, `tool_call` and `tool_result`, work as they do in pi. You can block or rewrite a call before it runs, and rewrite what comes back. Neither event carries a token count. The kernel runs code. It doesn't report what the model call that wrote the code cost. The [pi cost post](/blog/pi-cost-tracking) describes the same gap, because the fork didn't change this part.

This matters more here than usual. Prime Agent is built to run for hours with less supervision: daemon sessions that survive restarts, a bounded `/autonomous` mode, recursive subagents. A cost spike in that setup can run a long time before anyone looks.

## How the proxy gets the numbers

To price a model call, something has to sit between Prime Agent and the model. That is the ACP proxy. The installer adds a second extension next to the tool-call one, at `~/.prime/agent/extensions/acp-proxy.ts`. It registers an `acp` provider that points at the proxy. It does this only when `ACP_PROXY=1` is set.

`prime-acp` is the launcher that sets it. It reads your workspace key from `~/.acp/credentials`, sets `ACP_PROXY=1` and `--model acp/gemini-3.5-flash`, and starts Prime Agent. Set `ACP_PRIME_MODEL=<id>` to pick another model. If the gateway is unreachable, it starts plain Prime with a one-line note. Plain `prime` never loads the provider, so nothing changes for sessions you start that way.

One thing to know before you switch. `prime-acp` does not use your own model login. Only `claude-acp` and `codex-acp` forward that. `prime-acp` sends model calls through ACP's broker model. If you need a specific model or your own key for a run, start plain `prime` and accept that the run has no cost view.

The [Turn on Cost X-Ray](/cost-tracking) page has the full walkthrough.

## What you get

Once a session runs through `prime-acp`, each model call shows up priced in [the console](https://cloud.agenticcontrolplane.com), next to whatever the tool-call extension records for the `ipython` kernel:

- **Per-call cost.** Tokens in and out, priced to dollars, rolled up per session.
- **Prompt-cache hit rate.** In a long daemon session, a cold cache can keep costing you without any sign on screen.
- **Loop versus leaf.** How much of a long run goes to re-reading context, and how much to the next step of work.
- **A policy check on the tool calls the model asks for.** This is a second, coarser check. It doesn't replace the extension's own `tool_call` check on the kernel.

Because a daemon session can outlive any one terminal, the console's per-day rollup is the better view for a run that lasts days.

## Budget limits

A workspace has a spending budget, and the gateway can stop a caller's tool calls once their spend passes it. That halt is off until you turn it on. It reads spend from what ACP has priced, so a run that never goes through `prime-acp` has no spend on record and nothing to stop. I haven't tested the halt on a Prime Agent daemon session, so check it on a small budget before you rely on it overnight.

## Cost and tool-call checks are separate

The `prime-acp` launcher doesn't add tool-call checks, and the `tool_call` extension doesn't add cost. They are two installs that write to the same console. Prime Agent has no permission framework underneath either one, so the extension is the only thing checking tool calls. Run both if the agent runs unattended: one tells you what it was allowed to do, the other what it spent.

## Frequently asked questions



## Where to read more

- [Prime Agent's control model, explained](/controls/prime-agent): the tool_call/tool_result half, and the hasUI print-mode bug
- [pi cost tracking](/blog/pi-cost-tracking): the same pattern on the harness Prime Agent forked from
- [Hermes Agent cost tracking](/blog/hermes-cost-tracking): the in-process hook alternative
- [Claude Code cost tracking reference](/blog/claude-code-cost-tracking-reference) and [Codex CLI cost tracking](/blog/codex-cli-cost-tracking): the same for the other coding agents
