"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from .serverlesspriceunittype import ServerlessPriceUnitType
from friendli.core.types import BaseModel
from typing import Optional
from typing_extensions import NotRequired, TypedDict


class PricingModelTypedDict(TypedDict):
    """Pricing model supporting both token-based and time-based pricing."""

    input: float
    "Price per input token"
    output: float
    "Price per output token"
    response_time: NotRequired[float]
    "Price per response time in seconds"
    unit_type: NotRequired[ServerlessPriceUnitType]
    "Serverless price unit type."


class PricingModel(BaseModel):
    """Pricing model supporting both token-based and time-based pricing."""

    input: float
    "Price per input token"
    output: float
    "Price per output token"
    response_time: Optional[float] = 0
    "Price per response time in seconds"
    unit_type: Optional[ServerlessPriceUnitType] = None
    "Serverless price unit type."
