CoAgent8 - Source API
    Preparing search index...

    Function choosePricedModel

    • Chooses the model of a turn under a price limit: the default when its verified price is below the limit, else the highest-priced catalog model below it, catalog order breaking ties. Approval is not considered here: the controller asks for it as for any model. A model the user denies, the default included, is never chosen.

      Parameters

      • id: "codex" | "claude" | "agy"

        Backend, for messages.

      • catalog: ModelCatalog | undefined

        Its catalog, or undefined; without one only the default can be chosen.

      • fallback: ModelSelection | undefined

        The model the backend runs when none is named, if known.

      • constraint: PriceConstraint

        The limit and the call's effort.

      • prices: StoredPrices | undefined

        The price list the limit is checked against; undefined when none could be read.

      • denied: readonly string[] = []

        The user's governance.models.deny list.

      • replacesSuffix: boolean = false

        The CLI replaces a model's effort suffix with the call's effort (EffortRun).

      Returns ModelSelection

      PRICE_LIMIT stating why neither the default nor a catalog model meets the limit.