ModelPricing

org.llm4s.model.ModelPricing
See theModelPricing companion object
@Stable
final case class ModelPricing

Detailed pricing information for a model, in USD per unit; None where the model's metadata gives no price.

Build one with ModelPricing.apply and change it with the with* setters, each of which takes the value or an Option; the constructor and copy are private, so a new field never breaks callers. The constructor keeps its defaults because the JSON codec fills a missing key from them.

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def estimateCost(inputTokens: Int, outputTokens: Int): Option[Double]

Estimate the cost of a completion given token counts.

Estimate the cost of a completion given token counts.

Value parameters

inputTokens

Number of input tokens

outputTokens

Number of output tokens

Attributes

Returns

Estimated cost in dollars

def withCacheCreationInputTokenCost(cacheCreationInputTokenCost: Double): ModelPricing

Sets the cacheCreationInputTokenCost price.

Sets the cacheCreationInputTokenCost price.

Attributes

def withCacheCreationInputTokenCost(cacheCreationInputTokenCost: Option[Double]): ModelPricing

Sets, or with None clears, the cacheCreationInputTokenCost price.

Sets, or with None clears, the cacheCreationInputTokenCost price.

Attributes

def withCacheReadInputTokenCost(cacheReadInputTokenCost: Double): ModelPricing

Sets the cacheReadInputTokenCost price.

Sets the cacheReadInputTokenCost price.

Attributes

def withCacheReadInputTokenCost(cacheReadInputTokenCost: Option[Double]): ModelPricing

Sets, or with None clears, the cacheReadInputTokenCost price.

Sets, or with None clears, the cacheReadInputTokenCost price.

Attributes

def withInputCostPerAudioToken(inputCostPerAudioToken: Double): ModelPricing

Sets the inputCostPerAudioToken price.

Sets the inputCostPerAudioToken price.

Attributes

def withInputCostPerAudioToken(inputCostPerAudioToken: Option[Double]): ModelPricing

Sets, or with None clears, the inputCostPerAudioToken price.

Sets, or with None clears, the inputCostPerAudioToken price.

Attributes

def withInputCostPerImage(inputCostPerImage: Double): ModelPricing

Sets the inputCostPerImage price.

Sets the inputCostPerImage price.

Attributes

def withInputCostPerImage(inputCostPerImage: Option[Double]): ModelPricing

Sets, or with None clears, the inputCostPerImage price.

Sets, or with None clears, the inputCostPerImage price.

Attributes

def withInputCostPerPixel(inputCostPerPixel: Double): ModelPricing

Sets the inputCostPerPixel price.

Sets the inputCostPerPixel price.

Attributes

def withInputCostPerPixel(inputCostPerPixel: Option[Double]): ModelPricing

Sets, or with None clears, the inputCostPerPixel price.

Sets, or with None clears, the inputCostPerPixel price.

Attributes

def withInputCostPerToken(inputCostPerToken: Double): ModelPricing

Sets the inputCostPerToken price.

Sets the inputCostPerToken price.

Attributes

def withInputCostPerToken(inputCostPerToken: Option[Double]): ModelPricing

Sets, or with None clears, the inputCostPerToken price.

Sets, or with None clears, the inputCostPerToken price.

Attributes

def withInputCostPerTokenBatches(inputCostPerTokenBatches: Double): ModelPricing

Sets the inputCostPerTokenBatches price.

Sets the inputCostPerTokenBatches price.

Attributes

def withInputCostPerTokenBatches(inputCostPerTokenBatches: Option[Double]): ModelPricing

Sets, or with None clears, the inputCostPerTokenBatches price.

Sets, or with None clears, the inputCostPerTokenBatches price.

Attributes

def withInputCostPerTokenPriority(inputCostPerTokenPriority: Double): ModelPricing

Sets the inputCostPerTokenPriority price.

Sets the inputCostPerTokenPriority price.

Attributes

def withInputCostPerTokenPriority(inputCostPerTokenPriority: Option[Double]): ModelPricing

Sets, or with None clears, the inputCostPerTokenPriority price.

Sets, or with None clears, the inputCostPerTokenPriority price.

Attributes

def withOutputCostPerAudioToken(outputCostPerAudioToken: Double): ModelPricing

Sets the outputCostPerAudioToken price.

Sets the outputCostPerAudioToken price.

Attributes

def withOutputCostPerAudioToken(outputCostPerAudioToken: Option[Double]): ModelPricing

Sets, or with None clears, the outputCostPerAudioToken price.

Sets, or with None clears, the outputCostPerAudioToken price.

Attributes

def withOutputCostPerImage(outputCostPerImage: Double): ModelPricing

Sets the outputCostPerImage price.

Sets the outputCostPerImage price.

Attributes

def withOutputCostPerImage(outputCostPerImage: Option[Double]): ModelPricing

Sets, or with None clears, the outputCostPerImage price.

Sets, or with None clears, the outputCostPerImage price.

Attributes

def withOutputCostPerPixel(outputCostPerPixel: Double): ModelPricing

Sets the outputCostPerPixel price.

Sets the outputCostPerPixel price.

Attributes

def withOutputCostPerPixel(outputCostPerPixel: Option[Double]): ModelPricing

Sets, or with None clears, the outputCostPerPixel price.

Sets, or with None clears, the outputCostPerPixel price.

Attributes

def withOutputCostPerReasoningToken(outputCostPerReasoningToken: Double): ModelPricing

Sets the outputCostPerReasoningToken price.

Sets the outputCostPerReasoningToken price.

Attributes

def withOutputCostPerReasoningToken(outputCostPerReasoningToken: Option[Double]): ModelPricing

Sets, or with None clears, the outputCostPerReasoningToken price.

Sets, or with None clears, the outputCostPerReasoningToken price.

Attributes

def withOutputCostPerToken(outputCostPerToken: Double): ModelPricing

Sets the outputCostPerToken price.

Sets the outputCostPerToken price.

Attributes

def withOutputCostPerToken(outputCostPerToken: Option[Double]): ModelPricing

Sets, or with None clears, the outputCostPerToken price.

Sets, or with None clears, the outputCostPerToken price.

Attributes

def withOutputCostPerTokenBatches(outputCostPerTokenBatches: Double): ModelPricing

Sets the outputCostPerTokenBatches price.

Sets the outputCostPerTokenBatches price.

Attributes

def withOutputCostPerTokenBatches(outputCostPerTokenBatches: Option[Double]): ModelPricing

Sets, or with None clears, the outputCostPerTokenBatches price.

Sets, or with None clears, the outputCostPerTokenBatches price.

Attributes

def withOutputCostPerTokenPriority(outputCostPerTokenPriority: Double): ModelPricing

Sets the outputCostPerTokenPriority price.

Sets the outputCostPerTokenPriority price.

Attributes

def withOutputCostPerTokenPriority(outputCostPerTokenPriority: Option[Double]): ModelPricing

Sets, or with None clears, the outputCostPerTokenPriority price.

Sets, or with None clears, the outputCostPerTokenPriority price.

Attributes

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product