Yes, the `get_spans_dataframe` API call includes the LLM cost for each span if cost tracking is enabled and the required span attributes (`llm.token_count.prompt`, `llm.token_count.completion`, `llm.token_count.total`, `llm.model_name`, and `llm.provider`) are present. Phoenix computes and stores span-level costs, which are then accessible via the spans DataFrame API and visible in the UI and analytics features. For more, see <https://arize.com/docs/phoenix/tracing/how-to-tracing/cost-tracking#span-level-costs|cost tracking docs> and <https://arize.com/docs/phoenix/tracing/how-to-tracing/importing-and-exporting-traces/exporting-annotated-spans#%3AS1%3A|exporting spans>.
Would you like more detail on how to access or interpret the cost fields in the DataFrame?
Sources:
- <https://arize.com/docs/phoenix/tracing/how-to-tracing/cost-tracking#span-level-costs|Cost Tracking: Span-level costs>
- <https://arize.com/docs/phoenix/tracing/how-to-tracing/importing-and-exporting-traces/exporting-annotated-spans#%3AS1%3A|exporting spans>