Class PricingTierInput.Builder

java.lang.Object
com.langfuse.client.resources.commons.types.PricingTierInput.Builder
All Implemented Interfaces:
PricingTierInput._FinalStage, PricingTierInput.IsDefaultStage, PricingTierInput.NameStage, PricingTierInput.PriorityStage
Enclosing class:
PricingTierInput

  • Method Details

    • from

      Specified by:
      from in interface PricingTierInput.NameStage
    • name

      public PricingTierInput.IsDefaultStage name(@NotNull String name)

      Name of the pricing tier for display and identification purposes.

      Must be unique within the model. Common patterns: "Standard", "High Volume Tier", "Extended Context"

      Name of the pricing tier for display and identification purposes.

      Must be unique within the model. Common patterns: "Standard", "High Volume Tier", "Extended Context"

      Specified by:
      name in interface PricingTierInput.NameStage
      Returns:
      Reference to this so that method calls can be chained together.
    • isDefault

      public PricingTierInput.PriorityStage isDefault(boolean isDefault)

      Whether this is the default tier. Exactly one tier per model must be marked as default.

      Requirements for default tier:

      • Must have isDefault=true
      • Must have priority=0
      • Must have empty conditions array (conditions=[])

      The default tier acts as a fallback when no conditional tiers match.

      Whether this is the default tier. Exactly one tier per model must be marked as default.

      Requirements for default tier:

      • Must have isDefault=true
      • Must have priority=0
      • Must have empty conditions array (conditions=[])

      The default tier acts as a fallback when no conditional tiers match.

      Specified by:
      isDefault in interface PricingTierInput.IsDefaultStage
      Returns:
      Reference to this so that method calls can be chained together.
    • priority

      public PricingTierInput._FinalStage priority(int priority)

      Priority for tier matching evaluation. Lower numbers = higher priority (evaluated first).

      Must be unique within the model. The default tier must have priority=0. Conditional tiers should use priority 1, 2, 3, etc. based on their specificity.

      Priority for tier matching evaluation. Lower numbers = higher priority (evaluated first).

      Must be unique within the model. The default tier must have priority=0. Conditional tiers should use priority 1, 2, 3, etc. based on their specificity.

      Specified by:
      priority in interface PricingTierInput.PriorityStage
      Returns:
      Reference to this so that method calls can be chained together.
    • prices

      public PricingTierInput._FinalStage prices(String key, Double value)

      Prices (USD) by usage type for this tier. At least one price must be defined.

      Common usage types: "input", "output", "total", "request", "image" Prices are in USD per unit (e.g., per token).

      Example: {"input": 0.000003, "output": 0.000015} represents $3 per million input tokens and $15 per million output tokens.

      Specified by:
      prices in interface PricingTierInput._FinalStage
      Returns:
      Reference to this so that method calls can be chained together.
    • putAllPrices

      public PricingTierInput._FinalStage putAllPrices(Map<String,Double> prices)

      Prices (USD) by usage type for this tier. At least one price must be defined.

      Common usage types: "input", "output", "total", "request", "image" Prices are in USD per unit (e.g., per token).

      Example: {"input": 0.000003, "output": 0.000015} represents $3 per million input tokens and $15 per million output tokens.

      Specified by:
      putAllPrices in interface PricingTierInput._FinalStage
      Returns:
      Reference to this so that method calls can be chained together.
    • prices

      public PricingTierInput._FinalStage prices(Map<String,Double> prices)

      Prices (USD) by usage type for this tier. At least one price must be defined.

      Common usage types: "input", "output", "total", "request", "image" Prices are in USD per unit (e.g., per token).

      Example: {"input": 0.000003, "output": 0.000015} represents $3 per million input tokens and $15 per million output tokens.

      Specified by:
      prices in interface PricingTierInput._FinalStage
    • addAllConditions

      public PricingTierInput._FinalStage addAllConditions(List<PricingTierCondition> conditions)

      Array of conditions that must ALL be met for this tier to match (AND logic).

      The default tier must have an empty array (conditions=[]). Conditional tiers should define one or more conditions that specify when this tier's pricing applies.

      Each condition specifies a regex pattern, operator, and threshold value for matching against usage details.

      Specified by:
      addAllConditions in interface PricingTierInput._FinalStage
      Returns:
      Reference to this so that method calls can be chained together.
    • addConditions

      public PricingTierInput._FinalStage addConditions(PricingTierCondition conditions)

      Array of conditions that must ALL be met for this tier to match (AND logic).

      The default tier must have an empty array (conditions=[]). Conditional tiers should define one or more conditions that specify when this tier's pricing applies.

      Each condition specifies a regex pattern, operator, and threshold value for matching against usage details.

      Specified by:
      addConditions in interface PricingTierInput._FinalStage
      Returns:
      Reference to this so that method calls can be chained together.
    • conditions

      public PricingTierInput._FinalStage conditions(List<PricingTierCondition> conditions)

      Array of conditions that must ALL be met for this tier to match (AND logic).

      The default tier must have an empty array (conditions=[]). Conditional tiers should define one or more conditions that specify when this tier's pricing applies.

      Each condition specifies a regex pattern, operator, and threshold value for matching against usage details.

      Specified by:
      conditions in interface PricingTierInput._FinalStage
    • build

      public PricingTierInput build()
      Specified by:
      build in interface PricingTierInput._FinalStage
    • additionalProperty

      public PricingTierInput.Builder additionalProperty(String key, Object value)
      Specified by:
      additionalProperty in interface PricingTierInput._FinalStage
    • additionalProperties

      public PricingTierInput.Builder additionalProperties(Map<String,Object> additionalProperties)
      Specified by:
      additionalProperties in interface PricingTierInput._FinalStage