java.lang.Object
com.langfuse.client.resources.commons.types.Model

public final class Model extends Object
  • Method Details

    • getId

      public String getId()
    • getModelName

      public String getModelName()
      Returns:
      Name of the model definition. If multiple with the same name exist, they are applied in the following order: (1) custom over built-in, (2) newest according to startTime where model.startTime<observation.startTime
    • getMatchPattern

      public String getMatchPattern()
      Returns:
      Regex pattern which matches this model definition to generation.model. Useful in case of fine-tuned models. If you want to exact match, use (?i)^modelname$
    • getStartDate

      public Optional<OffsetDateTime> getStartDate()
      Returns:
      Apply only to generations which are newer than this ISO date.
    • getUnit

      public Optional<ModelUsageUnit> getUnit()
      Returns:
      Unit used by this model.
    • getInputPrice

      public Optional<Double> getInputPrice()
      Returns:
      Deprecated. See 'prices' instead. Price (USD) per input unit
    • getOutputPrice

      public Optional<Double> getOutputPrice()
      Returns:
      Deprecated. See 'prices' instead. Price (USD) per output unit
    • getTotalPrice

      public Optional<Double> getTotalPrice()
      Returns:
      Deprecated. See 'prices' instead. Price (USD) per total unit. Cannot be set if input or output price is set.
    • getTokenizerId

      public Optional<String> getTokenizerId()
      Returns:
      Optional. Tokenizer to be applied to observations which match to this model. See docs for more details.
    • getTokenizerConfig

      public Object getTokenizerConfig()
      Returns:
      Optional. Configuration for the selected tokenizer. Needs to be JSON. See docs for more details.
    • getIsLangfuseManaged

      public boolean getIsLangfuseManaged()
    • getCreatedAt

      public OffsetDateTime getCreatedAt()
      Returns:
      Timestamp when the model was created
    • getPrices

      public Map<String,ModelPrice> getPrices()
      Returns:
      Deprecated. Use 'pricingTiers' instead for models with usage-based pricing variations.

      This field shows prices by usage type from the default pricing tier. Maintained for backward compatibility. If the model uses tiered pricing, this field will be populated from the default tier's prices.

    • getPricingTiers

      public List<PricingTier> getPricingTiers()
      Returns:
      Array of pricing tiers with conditional pricing based on usage thresholds.

      Pricing tiers enable accurate cost tracking for models that charge different rates based on usage patterns (e.g., different rates for high-volume usage, large context windows, or cached tokens).

      Each model must have exactly one default tier (isDefault=true, priority=0) that serves as a fallback. Additional conditional tiers can be defined with specific matching criteria.

      If this array is empty, the model uses legacy flat pricing from the inputPrice/outputPrice/totalPrice fields.

    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • getAdditionalProperties

      public Map<String,Object> getAdditionalProperties()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • builder

      public static Model.IdStage builder()