Skip to content

TieredPricingTier

Base classes

Name Children Inherits
Schema
schemez.schema
Base class for configuration models.

⋔ Inheritance diagram

graph TD
  3686787324["data_models.TieredPricingTier"]
  330168112["schema.Schema"]
  3879467795["main.BaseModel"]
  2751680898["builtins.object"]
  330168112 --> 3686787324
  3879467795 --> 330168112
  2751680898 --> 3879467795

🛈 DocStrings

Bases: Schema

Single tier in a tiered pricing structure.

Source code in src/tokonomics/data_models.py
class TieredPricingTier(Schema):
    """Single tier in a tiered pricing structure."""

    range: tuple[float, float]
    """Token range [start, end] for this tier."""

    input_cost_per_token: Decimal = Field(ge=0)
    """Input token cost for this tier."""

    output_cost_per_token: Decimal = Field(ge=0)
    """Output token cost for this tier."""

    output_cost_per_reasoning_token: Decimal | None = Field(None, ge=0)
    """Output cost per reasoning token for this tier."""

    cache_read_input_token_cost: Decimal | None = Field(None, ge=0)
    """Cache read input token cost for this tier."""

cache_read_input_token_cost class-attribute instance-attribute

cache_read_input_token_cost: Decimal | None = Field(None, ge=0)

Cache read input token cost for this tier.

input_cost_per_token class-attribute instance-attribute

input_cost_per_token: Decimal = Field(ge=0)

Input token cost for this tier.

output_cost_per_reasoning_token class-attribute instance-attribute

output_cost_per_reasoning_token: Decimal | None = Field(None, ge=0)

Output cost per reasoning token for this tier.

output_cost_per_token class-attribute instance-attribute

output_cost_per_token: Decimal = Field(ge=0)

Output token cost for this tier.

range instance-attribute

range: tuple[float, float]

Token range [start, end] for this tier.

:fa-brands-github: Show source on GitHub