Cost Agent: find where your LLM and agent spend goes with your traces

AI costs don’t always scale predictably with traffic. A retry loop, oversized context window, or unnecessarily expensive model can make a small number of traces disproportionately expensive.

Cost Agent is a managed agent in Arize AX that analyzes your application traces to find recurring sources of unnecessary LLM, coding agent, and AI spend. It breaks spend down by model, task, and time window, then files ranked cost issues. Each issue comes with the potential savings behind it and a proposed fix, such as moving an agent eval judge to a cheaper model.

Cost Agent is now available to Arize AX Enterprise accounts. Pricing for Managed Agents, including the Cost Agent, varies by plan, checkout arize.com/pricing for more info.

Try Arize AX

Build better agents with Arize

Trace, evaluate, and learn. Build agents that work with Arize AX and start tracing your runs today.

Prefer open source? Try Arize Phoenix for self-hosted, open source agent observability.

What LLM, coding agent, and AI cost issues does Cost Agent find?

  • Over-provisioned model tiers. When a costly model is doing low-complexity work, the agent compares what you spend today with what the same call volume would cost on a cheaper tier.
  • Redundant or duplicate calls. It counts the duplicates and adds up the cost they waste.
  • Runaway retries. When a trace keeps calling the model after a failure, it reports the number of retries per trace and what they cost.
  • Expensive prompts. Large prompts can come from growing context or oversized tool responses. It reports prompt-token percentiles and the marginal cost of the extra tokens.

How Cost Agent finds recurring LLM and agent cost issues

Findings are grouped by root cause, so a recurring pattern shows up as one issue instead of hundreds of individual expensive calls.

Before you switch models, check that the cheaper one holds up. How to reduce LLM costs without sacrificing quality walks through validating lower-cost alternatives with evals.

How Cost Agent calculates LLM and agent costs

If a span has a cost attribute, the agent uses it. Otherwise, Arize AX calculates cost from the span’s token counts using the configured pricing for that model and provider. Spans without enough information to calculate cost are excluded, and Cost Agent reports how many were left out.

If your span attributes aren’t showing cost, set up cost tracking before running the Cost Agent.

How to run Cost Agent in Arize AX

Each Cost Agent run analyzes one AX project and returns ranked opportunities to reduce spend, including the evidence behind the finding, estimated savings, and a proposed fix.

In Arize AX, go to Signal & Agents → + New Agent → Cost Agent. Select the project you want analyzed (each run reads one project) and then choose a mode:

Automation run

Runs on a schedule, weekly by default. Each run files ranked cost issues in the same place Signal files its issues, scoped to spend instead of correctness. Subsequent runs can reconfirm existing issues without creating duplicates.

Session run

Runs once and returns the analysis in the transcript: total spend for the window, a per-model breakdown, and ranked bottlenecks with a cost fix for each.

Before you launch, you can edit the task prompt and add context about your cost constraints and approved models to refine the analysis. To let the agent open a pull request for a routing or config change, add the optional GitHub skill.

Full setup details are in the docs.

Go deeper on LLM and agent cost optimization

On Arize AX Enterprise?

Get started with our docs and run Cost Agent on your highest spend project.

Not yet using Arize AX?

Book a demo

Get the latest on AI & Observability

Sign up for our newsletter, The Evaluator—and stay in the know with updates and new resources:

Don’t ship vibes.

Arize gives AI teams observability and evals to understand and improve agent performance.