How Arize AX calculates cost
- If the span already carries
llm.cost.total,llm.cost.prompt, orllm.cost.completion, Arize AX keeps those values and skips the lookup. - Otherwise it reads the model name from the first of these that is set:
llm.model_name, themodel_namekey inllm.invocation_parameters, or themodel_namekey inmetadata. - It picks the cost config for that model. A config scoped to the span’s space wins over one scoped to its organization, which wins over an Arize default. Within a scope, an exact model name match beats a regex match, and a config whose provider matches
llm.providerbeats one with no provider. - It multiplies each token count on the span by the matching token type’s price per 1M tokens in the config. Tiered pricing applies a different price once the token count passes a threshold.
Supported token count fields
Arize AX reads token counts from the OpenInference semantic conventions. Auto-instrumentation sets them. With manual instrumentation, set them yourself.
You can add your own token types under
prompt_details or completion_details. Arize AX prices any token count whose name matches a token type in the cost config.
Cost attributes on spans
Arize AX writes the result back to the span. Set these yourself to supply your own cost instead.Use cost data
Cost attributes work anywhere span attributes do: filter traces or spans above a cost threshold, create monitors on high-cost traces, and build dashboards on specific token types. The trace view shows the summed cost of every LLM span in the request.

Next steps
Custom Cost Config
Set the price per token for a model that has no default, or replace a default price.
Customize your traces
Add the semantic conventions, including token counts, that Arize AX reads from your spans.