Skip to main content

Module pricing

Module pricing 

Source

Structs§

ModelPricing
Model Pricing tiers (USD per 1 million tokens).

Functions§

calculate_cost
Calculates the cost in USD for a given token usage block. Applies a 90% discount for cached input tokens.
calculate_estimated_cost
Calculates a rough estimate for non-streamed or partial data.
get_pricing
Returns the pricing tier for a model based on its ID. Benchmark rates based on standard cloud provider tiers.