Class PricingTier.Builder
- All Implemented Interfaces:
PricingTier._FinalStage,PricingTier.IdStage,PricingTier.IsDefaultStage,PricingTier.NameStage,PricingTier.PriorityStage
- Enclosing class:
PricingTier
-
Method Summary
Modifier and TypeMethodDescriptionaddAllConditions(List<PricingTierCondition> conditions) Array of conditions that must ALL be met for this tier to match (AND logic).addConditions(PricingTierCondition conditions) Array of conditions that must ALL be met for this tier to match (AND logic).additionalProperties(Map<String, Object> additionalProperties) additionalProperty(String key, Object value) build()conditions(List<PricingTierCondition> conditions) Array of conditions that must ALL be met for this tier to match (AND logic).from(PricingTier other) Unique identifier for the pricing tierisDefault(boolean isDefault) Whether this is the default tier.Name of the pricing tier for display and identification purposes.Prices (USD) by usage type for this tier.Prices (USD) by usage type for this tier.priority(int priority) Priority for tier matching evaluation.putAllPrices(Map<String, Double> prices) Prices (USD) by usage type for this tier.
-
Method Details
-
from
- Specified by:
fromin interfacePricingTier.IdStage
-
id
Unique identifier for the pricing tier
Unique identifier for the pricing tier
- Specified by:
idin interfacePricingTier.IdStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
name
Name of the pricing tier for display and identification purposes.
Examples: "Standard", "High Volume Tier", "Large Context", "Extended Context Tier"
Name of the pricing tier for display and identification purposes.
Examples: "Standard", "High Volume Tier", "Large Context", "Extended Context Tier"
- Specified by:
namein interfacePricingTier.NameStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
isDefault
Whether this is the default tier. Every model must have exactly one default tier with priority 0 and no conditions.
The default tier serves as a fallback when no conditional tiers match, ensuring cost calculation always succeeds. It typically represents the base pricing for standard usage patterns.
Whether this is the default tier. Every model must have exactly one default tier with priority 0 and no conditions.
The default tier serves as a fallback when no conditional tiers match, ensuring cost calculation always succeeds. It typically represents the base pricing for standard usage patterns.
- Specified by:
isDefaultin interfacePricingTier.IsDefaultStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
priority
Priority for tier matching evaluation. Lower numbers = higher priority (evaluated first).
The default tier must always have priority 0. Conditional tiers should have priority 1, 2, 3, etc.
Example ordering:
- Priority 0: Default tier (no conditions, always matches as fallback)
- Priority 1: High usage tier (e.g., >200K tokens)
- Priority 2: Medium usage tier (e.g., >100K tokens)
This ensures more specific conditions are checked before general ones.
Priority for tier matching evaluation. Lower numbers = higher priority (evaluated first).
The default tier must always have priority 0. Conditional tiers should have priority 1, 2, 3, etc.
Example ordering:
- Priority 0: Default tier (no conditions, always matches as fallback)
- Priority 1: High usage tier (e.g., >200K tokens)
- Priority 2: Medium usage tier (e.g., >100K tokens)
This ensures more specific conditions are checked before general ones.
- Specified by:
priorityin interfacePricingTier.PriorityStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
prices
Prices (USD) by usage type for this tier.
Common usage types: "input", "output", "total", "request", "image" Prices are specified in USD per unit (e.g., per token, per request, per second).
Example: {"input": 0.000003, "output": 0.000015} means $3 per million input tokens and $15 per million output tokens.
- Specified by:
pricesin interfacePricingTier._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
putAllPrices
Prices (USD) by usage type for this tier.
Common usage types: "input", "output", "total", "request", "image" Prices are specified in USD per unit (e.g., per token, per request, per second).
Example: {"input": 0.000003, "output": 0.000015} means $3 per million input tokens and $15 per million output tokens.
- Specified by:
putAllPricesin interfacePricingTier._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
prices
Prices (USD) by usage type for this tier.
Common usage types: "input", "output", "total", "request", "image" Prices are specified in USD per unit (e.g., per token, per request, per second).
Example: {"input": 0.000003, "output": 0.000015} means $3 per million input tokens and $15 per million output tokens.
- Specified by:
pricesin interfacePricingTier._FinalStage
-
addAllConditions
Array of conditions that must ALL be met for this tier to match (AND logic).
The default tier must have an empty conditions array. Conditional tiers should have one or more conditions that define when this tier's pricing applies.
Multiple conditions enable complex matching scenarios (e.g., "high input tokens AND low output tokens").
- Specified by:
addAllConditionsin interfacePricingTier._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
addConditions
Array of conditions that must ALL be met for this tier to match (AND logic).
The default tier must have an empty conditions array. Conditional tiers should have one or more conditions that define when this tier's pricing applies.
Multiple conditions enable complex matching scenarios (e.g., "high input tokens AND low output tokens").
- Specified by:
addConditionsin interfacePricingTier._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
conditions
Array of conditions that must ALL be met for this tier to match (AND logic).
The default tier must have an empty conditions array. Conditional tiers should have one or more conditions that define when this tier's pricing applies.
Multiple conditions enable complex matching scenarios (e.g., "high input tokens AND low output tokens").
- Specified by:
conditionsin interfacePricingTier._FinalStage
-
build
- Specified by:
buildin interfacePricingTier._FinalStage
-
additionalProperty
- Specified by:
additionalPropertyin interfacePricingTier._FinalStage
-
additionalProperties
- Specified by:
additionalPropertiesin interfacePricingTier._FinalStage
-