Skip to main content

Overview

Calculate the cost of an LLM inference call using FlatRateCostCalculator. Pricing is decoupled from usage — you define rates with InferencePricing, get token counts from the response’s InferenceUsage, and the calculator produces a Cost value object with total and per-category breakdown.

Example