# This file was auto-generated by Fern from our API Definition.

import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ..core.serialization import FieldMetadata


class ModelPricing(UniversalBaseModel):
    """
    Pricing information for a model.
    """

    input_price_per1m_synapses: typing_extensions.Annotated[
        float,
        FieldMetadata(alias="input_price_per_1m_synapses"),
        pydantic.Field(alias="input_price_per_1m_synapses", description="Price per 1M input synapses in CHF"),
    ]
    output_price_per1m_synapses: typing_extensions.Annotated[
        float,
        FieldMetadata(alias="output_price_per_1m_synapses"),
        pydantic.Field(alias="output_price_per_1m_synapses", description="Price per 1M output synapses in CHF"),
    ]
    consumption_synapses_per_second: float = pydantic.Field()
    """
    Synapses consumed per unit of input
    """

    currency: typing.Optional[str] = pydantic.Field(default=None)
    """
    Currency code
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
