2026-10. See Usage for how events work.
Cost events
Add a_cost object to an event’s metadata. For LLM calls, add _llm too, so costs can be broken down by model and vendor.
_cost
The amount is in cents, not dollars:
150 is $1.50, and `0.0014` is $0.000014. Fractions of a cent are kept, so you can record the cost of a single API call.
_llm
These two are the only nested objects metadata accepts. A meter can read inside them with a dot path, like
_cost.amount or _llm.total_tokens.
The LLM strategy adds _llm for you, and _cost when you give it a .cost() function. Other ingestion strategies accept .cost() too.
Traces
One user action often costs several things: an agent run makes three LLM calls and a web search. Send each as an event, and link them withparent_id so their costs add up under one trace.
- Send the root event with your own
external_id, such as a request ID. - Send each child with
parent_idset to thatexternal_id, or to the root event’s Polar ID.
agent_run adds up the costs of its children, so you see what a whole run costs.
If you trace with OpenTelemetry, the PolarTraceExporter sends spans as events with the parent links already set. See OpenTelemetry.
Where costs show up
Dashboard only, except the metrics below, which the API, CLI and MCP server can read.
- Overview: the cost metrics as charts, then:
- Breakdown: event types ranked by total spend in the period.
- Changes: the biggest cost movers compared to the previous period.
- By Customer: customers ranked by total cost.
- Anomalies: individual traces whose total cost is at or above the 99th percentile for their event type.
- LLM: costs from events with
_llm, ranked By Model, By Vendor and By Customer.
Cost metrics
These metrics come from your_cost data and your revenue. Find them as charts on Analytics → Costs and in the Costs and Usage groups on Analytics → Metrics. Amounts are in cents.
Lifetime Value (
ltv) also subtracts cost per user from revenue per user. See Metrics for every metric.
customer_id to get one customer’s costs and margin.
From the CLI or your agent
Costs are sent with events, from your application. Reading them works everywhere:Prompt

