Turn on Cost X-Ray: route your model calls through ACP
There are two places ACP can sit in your agent, and they capture different things. Most integration guides wire up the first. If you want to see cost, you need the second.
| Capture point | What you install | What you get |
|---|---|---|
| Tool hooks (Claude Code shell hook, Hermes plugin, etc.) | A hook that fires on every tool call | Policy enforcement (allow / deny / ask) + a full tool-call audit trail with latency and attribution |
| Model proxy | A one-line change to your model client’s base URL | Per-call token → dollar cost, prompt-cache hit rate, and the loop-vs-leaf cost X-ray — plus governance of the tool calls the model emits |
Tool hooks see tools. They never see the model’s token usage, so they can’t show you spend. Cost is metered at the model proxy — the endpoint that sits in front of the LLM API, counts tokens on every request and response, and prices them. To get the cost X-ray, your agent’s model calls have to go through it.
This matters most for autonomous, API-metered agents — the ones running unattended against a paid API, where nobody is watching the bill in real time. That’s exactly where a surprise cost shows up a month later instead of the moment it happens.
The change
Point your model client at the ACP proxy and authenticate with an ACP key. Get a key (format gsk_yourslug_xxxxxxxxxxxx) from cloud.agenticcontrolplane.com — the slug encodes your workspace, so the key resolves the tenant automatically.
OpenAI-compatible agents
Most agent frameworks speak the OpenAI Chat Completions API under the hood. Swap the base URL:
from openai import OpenAI
client = OpenAI(
base_url="https://api.agenticcontrolplane.com/v1",
api_key=os.environ["ACP_API_KEY"], # gsk_yourslug_...
default_headers={
# Optional: tag this agent so the dashboard groups its calls
# as a distinct row. Use a different name per agent/role.
"x-acp-agent-name": "my-agent",
},
)
Anything that lets you set an OpenAI-compatible base URL — the openai SDK, LangChain’s ChatOpenAI, CrewAI, an OPENAI_BASE_URL environment variable — routes through the proxy with this one change. The proxy is multi-provider and routes by model id, so gpt-4o, claude-*, and gemini-* all work through the same endpoint.
Anthropic-native agents
If your agent calls the Anthropic Messages API directly, point it at the Anthropic-shaped proxy instead:
export ANTHROPIC_BASE_URL="https://api.agenticcontrolplane.com/anthropic/v1"
export ANTHROPIC_AUTH_TOKEN="gsk_yourslug_..." # an ACP key, not an Anthropic key
What you’ll see
Within minutes of your agent running, cloud.agenticcontrolplane.com shows, per model call:
- Cost — tokens in / out, priced to dollars, per call and rolled up per run and per agent
- Prompt-cache hit rate — so you can catch a cold cache silently doubling your bill
- The loop-vs-leaf X-ray — how much you spend driving the orchestration loop vs. doing leaf work
- Governance of the tool calls the model emits — the proxy sees the tool_use blocks in the model’s output, so you get policy enforcement on tools even without a separate tool hook
This is a live Claude Code session running through the proxy — every model call a row with its model, tokens, cache hits, and priced cost, interleaved with the tool calls it drove, each stamped with the governance decision and the human identity behind it:

And it rolls up: the Home view splits workspace-billed spend from subscription/BYO traffic priced at API rates (never summed — they’re different money), buckets it by the calendar day it actually occurred, and surfaces the runs worth your attention:

Which one do I need?
There’s no menu here — there’s a default and an upgrade.
Everyone starts with the governance install — the one command in your runtime’s integration guide (curl | bash for the coding agents, pip install hermes-acp for Hermes). It hooks tool calls at the point of execution: policy enforcement, full audit trail, identity attribution. It does not sit in your model’s data path — your prompts and completions never touch ACP. Zero configuration decisions.
Add the cost X-ray when you want spend visibility. This is the step this page documents, and it’s a deliberate opt-in, because it means something specific: your model calls route through ACP’s proxy. Here’s exactly what that does and doesn’t mean:
- Your provider still bills you directly. ACP forwards your own credential (subscription OAuth or API key) upstream — we never substitute or hold it.
- What we persist is metadata: model, token counts, cache-hit rates, priced cost, and governance decisions. Prompt and completion content transits the proxy and is scanned in-memory (PII, policy) — it is not stored unless you explicitly turn on content previews in your logging settings.
- The escape hatch stays open. The install never replaces your plain client —
claudekeeps working untouched next toclaude-acp; unset one env var and Hermes talks to its provider directly again.
| Setup | Governance | Cost X-ray | The trade |
|---|---|---|---|
| Hook only (the default install) | ✅ at execution, all origins | ❌ | Nothing in your model’s data path |
| Hook + proxy (add when you want cost) | ✅ defense in depth | ✅ | Model calls transit ACP (metadata persisted, content not) |
If routing model traffic through anyone is off the table for you — some teams’ policies say exactly that — the hook alone is a complete governance and audit story, and the cost X-ray will be waiting if that changes.
Per-integration notes
Every integration guide covers the governance install for that runtime. To add cost metering, apply the base-URL change above wherever that runtime configures its model endpoint. A few specifics:
- Coding agents (Hermes, Claude Code, Codex, Cursor): the hook governs tools; set the model base URL to add cost. See each guide’s “cost X-ray” section.
- Framework agents (CrewAI, LangGraph, AutoGen, Pydantic AI, Vercel AI SDK): these use an OpenAI- or Anthropic-compatible client directly — the base-URL swap is the whole integration.
- Hosted agents (Bedrock, Vertex, Foundry): route the model endpoint through the proxy where the platform allows a custom base URL.