get_llm_expensive_traces
Find LLM traces with high token usage to optimize costs and identify inefficient prompts.
Instructions
Find traces with highest LLM token usage.
Useful for cost optimization and identifying inefficient prompts.
Args: limit: Maximum number of traces to return (default: 10) start_time: Start time in ISO 8601 format (e.g., 2024-01-01T00:00:00Z) end_time: End time in ISO 8601 format min_tokens: Minimum token count threshold (only return traces above this) service_name: Filter by service name gen_ai_request_model: Filter by requested model name (e.g., "gpt-4") gen_ai_response_model: Filter by actual model used (e.g., "gpt-4-0613")
Returns: JSON string with top N most expensive traces sorted by total token usage
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| end_time | No | ||
| min_tokens | No | ||
| start_time | No | ||
| service_name | No | ||
| gen_ai_request_model | No | ||
| gen_ai_response_model | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |