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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel


class RunUsage(UncheckedBaseModel):
    """
    Usage credits consumed by a run.

    **Availability:** This field will not be returned for:
    * Runs created before October 7, 2025
    * Customers on legacy billing systems

    For more details on how credits work, see our [Credits Guide](https://docs.extend.ai/2026-02-09/product/general/how-credits-work).
    """

    credits: float = pydantic.Field()
    """
    The number of credits consumed for this run.
    """

    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
