When using the Gateway provider, models are returned in specialized formats based on their modality. All models include a label, a chef (derived from the model ID prefix), and a priceIndicator.
Text Models (TersaTextModel)
Text models include a getCost function that calculates cost based on input and output tokens:
getCost({ input: number; output: number }) => number.
Image Models (TersaImageModel)
Image models include a getCost function that returns a flat cost per image:
getCost() => number.
Video Models (TersaVideoModel)
Video models include a getCost function that returns a flat cost per video:
getCost() => number.
Price Brackets
The priceIndicator property uses the PriceBracket type to indicate relative cost compared to other models in the set:
lowest (bottom 20th percentile)low (up to 40th percentile)high (above 60th percentile)highest (above 80th percentile)undefined (middle 20%, considered 'on par')