Skip to content

Overview

LLM Cost Tracking shows which AI agents, sessions, models, and hosts drive your organization's AI spending.

Start collecting usage

  1. Enable AI Agent Watch for the Infra Apps receiving your machines' data, and use a Sematext Agent version that supports cost collection on those hosts.
  2. On macOS and Windows, complete Claude Code or Codex setup. Telemetry is needed for token usage; hooks alone do not provide complete usage reporting.
  3. Start an AI-agent session that makes a model request. In Explore, look for llm_usage events for that agent and host.
  4. Open AI Agent Watch → LLM Costs to compare agents, models, and sessions. Use Cost by Infrastructure to locate spending by host, namespace, or cluster.

How costs are calculated

Each llm_usage event carries the available model, provider, and token counts. Sematext calculates the call's cost using the model's default pricing rates, which you can override to reflect negotiated rates or discounts agreed with your provider. At session end, captured call costs are summed into a session total.

Input, output, cache reads, and cache writes can have different rates. Reasoning tokens are included in output tokens. See Pricing and Calculations for rate selection, overrides, and missing costs.

Costs are estimates; reported token counts are exact. Linux uses the service tier reported in each LLM usage event, while macOS and Windows use standard API rates when no service tier is reported. See Understanding estimated costs for details.

If you have a fixed monthly subscription or use reserved or scale tiers, token reports still help you compare consumption across agents, models, machines, and sessions. Calculated costs do not allocate a subscription fee, and usage explicitly reported as reserved or scale is left unpriced. See Subscriptions, reserved capacity, and scale tiers for how to interpret these reports and respond to pricing alerts.

Investigate and control spending

Cost alerts notify you about usage. They do not enforce a spending cap or stop model requests.