Skip to main content

Module costs

Module costs 

Source
Expand description

Cost calculation, usage tracking, and pricing. Cost calculation, usage tracking, and pricing logic.

Structs§

EndpointUsage
Accumulated usage for a single endpoint.
LlmResponse
Result of an LLM chat call including usage data.
LlmUsage
Usage info extracted from an LLM API response.
UsageSnapshot
Aggregated usage across all endpoints for a test or scenario run.
UsageTracker
Thread-safe usage tracker for the test runner.

Functions§

calculate_llm_cost
Calculates the cost of an LLM call based on token pricing.
extract_usage
Extracts token usage from an OpenAI-compatible API response JSON.