Evalkeeper
    Preparing search index...

    Function costOf

    • What a call cost, from the AI SDK's usage and your catalog's prices; null when the model has no price. Input read from or written to the provider's prompt cache (usage.inputTokenDetails) is priced at the catalog's cache prices when it has them. Report it through a suite's ctx.onCost so tests show real cost per answer.

      Parameters

      • models: ModelCatalog
      • model: string
      • usage: {
            inputTokenDetails?: {
                cacheReadTokens?: number;
                cacheWriteTokens?: number;
            };
            inputTokens?: number;
            outputTokens?: number;
        }

        A call's usage: a language model's, or a decision's.

      Returns number | null