NewToken-spend audit for Claude Code, powered by your Agent Policy Router

Tokenomics

Quantify where your LLM/agent token spend is going — and reduce it — without losing the oversight your policy already gives you.

Redundant context, unbounded retries, unoptimized prompt chains, no caching: a real cost-reduction report on your Claude Code sessions, plus an optional opt-in to route your policy-governed traffic through the cheapest sufficient model too.

Real usage, not a guess

The gateway proxies Claude Code's actual session traffic — system prompt, conversation history, tool definitions — and captures real per-request token/cost telemetry.

Privacy-first, always

When your org's privacy guard is configured, it inspects raw content before any model call — including the gateway's own optimization sub-calls, not just the final forwarded request.

Cheapest sufficient model

APR's own policy checks can opt into routing through the cheapest model that's still safe for the risk tolerance in play — never downgraded below a safe floor for low-risk-tolerance or health policies.

Measured, not marketed

Every dollar figure traces back to real per-token pricing and real token counts — savings are naive cost minus actual cost, never a hardcoded percentage.

Governed, not just cheap

Customers who already enforce policy with APR can get token optimization on the exact same call, in the same response — no separate integration for the two capabilities.

You keep your own key

The gateway forwards using your organization's own Anthropic API key — GuardEntry doesn't eat inference cost, it earns on the audit and optimization value.

Two ways to save — pick one or both

The primary path is routing Claude Code itself through the gateway. If you already use the Agent Policy Router, you can also opt its own checks into the same optimization.

1. Point Claude Code at the gateway (VS Code extension)

json
{
  "claudeCode.environmentVariables": [
    { "name": "ANTHROPIC_BASE_URL", "value": "https://app.guardentry.ai/api/gateway" },
    { "name": "ANTHROPIC_AUTH_TOKEN", "value": "ge_gw_<your-key>" }
  ]
}

2. Optionally, opt APR's own policy checks into the same optimization

bash
curl -X POST https://app.guardentry.ai/api/v2/policy-router/evaluate \
  -H "Authorization: Bearer $GUARDENTRY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Delete all rows from the customers table",
    "actorType": "agent.coding-assistant",
    "optimizeTokens": true
  }'

The same response that carries your policy decision also carries tokenUsage, costUsd, and naiveCostUsd — one call, both answers.

Figures are scoped to what each surface actually sees — the gateway reports on your real Claude Code session traffic, APR's optimize flag reports on policy-governed traffic. The two are never merged into one number in the dashboard or report.

See what your agents are spending

Set up the gateway in a few minutes and watch real savings data accumulate in your dashboard.