Search Results for

    Show / Hide Table of Contents

    Class ModelPrice

    Abstract base class representing the pricing information for a model usage tier. Derived classes represent specific billing units such as per-token, per-image, or per-second.

    Inheritance
    object
    ModelPrice
    AudioPrice
    FreePrice
    ImagePrice
    OcrPrice
    RequestPrice
    TokenPrice
    TranscriptionPrice
    WebSearchPrice
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: Glitch9.AIDevKit
    Assembly: Glitch9.AIDevKit.dll
    Syntax
    [Serializable]
    [JsonConverter(typeof(ModelPriceJsonConverter))]
    public abstract class ModelPrice

    Constructors

    | Edit this page View Source

    ModelPrice()

    Declaration
    public ModelPrice()
    | Edit this page View Source

    ModelPrice(UsageType, double)

    Declaration
    protected ModelPrice(UsageType type, double costInUsd)
    Parameters
    Type Name Description
    UsageType type
    double costInUsd

    Fields

    | Edit this page View Source

    m_TypeNameCache

    Declaration
    protected string m_TypeNameCache
    Field Value
    Type Description
    string

    Properties

    | Edit this page View Source

    CostInUsd

    Declaration
    [JsonIgnore]
    public double CostInUsd { get; }
    Property Value
    Type Description
    double
    | Edit this page View Source

    Type

    Declaration
    [JsonIgnore]
    public UsageType Type { get; }
    Property Value
    Type Description
    UsageType

    Methods

    | Edit this page View Source

    CalcCostInUsd(double)

    Calculates the total cost in USD for the given usage amount.

    Declaration
    public double CalcCostInUsd(double amount)
    Parameters
    Type Name Description
    double amount
    Returns
    Type Description
    double
    | Edit this page View Source

    Free()

    Declaration
    public static ModelPrice[] Free()
    Returns
    Type Description
    ModelPrice[]
    | Edit this page View Source

    GetTypeName()

    Returns a human-readable label for this price type (e.g. "Input Token", "HD Image").

    Declaration
    public virtual string GetTypeName()
    Returns
    Type Description
    string
    | Edit this page View Source

    PerCharacter(double)

    Declaration
    public static ModelPrice[] PerCharacter(double cost)
    Parameters
    Type Name Description
    double cost
    Returns
    Type Description
    ModelPrice[]
    | Edit this page View Source

    PerICO(double, double, double)

    Declaration
    public static ModelPrice[] PerICO(double input, double cachedInput, double output)
    Parameters
    Type Name Description
    double input
    double cachedInput
    double output
    Returns
    Type Description
    ModelPrice[]
    | Edit this page View Source

    PerIO(double, double)

    Declaration
    public static ModelPrice[] PerIO(double input, double output)
    Parameters
    Type Name Description
    double input
    double output
    Returns
    Type Description
    ModelPrice[]
    | Edit this page View Source

    PerImage(double)

    Declaration
    public static ModelPrice[] PerImage(double cost)
    Parameters
    Type Name Description
    double cost
    Returns
    Type Description
    ModelPrice[]
    | Edit this page View Source

    PerInputToken(double)

    Declaration
    public static ModelPrice[] PerInputToken(double cost)
    Parameters
    Type Name Description
    double cost
    Returns
    Type Description
    ModelPrice[]
    | Edit this page View Source

    PerMinute(double, bool)

    Declaration
    public static ModelPrice[] PerMinute(double cost, bool isEstimated = false)
    Parameters
    Type Name Description
    double cost
    bool isEstimated
    Returns
    Type Description
    ModelPrice[]
    | Edit this page View Source

    PerRequest(double)

    Declaration
    public static ModelPrice[] PerRequest(double cost)
    Parameters
    Type Name Description
    double cost
    Returns
    Type Description
    ModelPrice[]
    | Edit this page View Source

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    string
    Overrides
    object.ToString()

    Extension Methods

    ArrayExtensions.ToArrayOrEmpty<T>(T)
    ArrayExtensions.ToArrayOrNull<T>(T)
    EventExtensions.ToDelta<T>(T, string, int, string, bool)
    EventExtensions.ToDone<T>(T, string, int, string)
    EventExtensions.ToEvent<T>(T)
    EventExtensions.UpcastDelta<T1, T2>(T1, string, int, string, bool)
    FallbackExtensions.IsOr<TParent, TChild>(TParent, TChild)
    ResponseCastingExtensions.GetResult<T>(T)
    SystemExtensions.GetName(object)
    • Edit this page
    • View Source
    In this article
    Back to top AI DevKit Documentation