Class PricingTierCondition

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

public final class PricingTierCondition extends Object
  • Method Details

    • getUsageDetailPattern

      public String getUsageDetailPattern()
      Returns:
      Regex pattern to match against usage detail keys. All matching keys' values are summed for threshold comparison.

      Examples:

      • "^input" matches "input", "input_tokens", "input_cached", etc.
      • "^(input|prompt)" matches both "input_tokens" and "prompt_tokens"
      • "_cache$" matches "input_cache", "output_cache", etc.

      The pattern is case-insensitive by default. If no keys match, the sum is treated as zero.

    • getOperator

      public PricingTierOperator getOperator()
      Returns:
      Comparison operator to apply between the summed value and the threshold.
      • gt: greater than (sum > threshold)
      • gte: greater than or equal (sum >= threshold)
      • lt: less than (sum < threshold)
      • lte: less than or equal (sum <= threshold)
      • eq: equal (sum == threshold)
      • neq: not equal (sum != threshold)
    • getValue

      public double getValue()
      Returns:
      Threshold value for comparison. For token-based pricing, this is typically the token count threshold (e.g., 200000 for a 200K token threshold).
    • getCaseSensitive

      public boolean getCaseSensitive()
      Returns:
      Whether the regex pattern matching is case-sensitive. Default is false (case-insensitive matching).
    • 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