/** * model-prices.ts — Single source of truth for per-model pricing. * * Iter 31 — Previously the price table existed in three scripts (train- * bundled-krr.mjs, auto-retrain-router.mjs, calibration-check.mjs) AND was * derived from the openrouter-alts.json sidecar for the bundled list. As * cost-aware features land (trajectory outcomes, cost-savings observability, * cost-ceiling routing), they need ONE canonical price lookup. This module * is it. * * Prices are blended ($/Mtok) using a 1×input + 3×output mix, reflecting * the average input/output token ratio for code tasks. To compute spend * for a specific call: * * const usd = costUsd(modelId, inputTokens, outputTokens); * * Unknown model ids fall back to a conservative $1/Mtok blended estimate * so callers always get a number (cost-tracking doesn't silently drop). * * Source: OpenRouter price page snapshot, ADR-149 bench dates. * * @module model-prices */ /** Per-million-token input and output prices ($USD). */ export interface ModelPrice { in: number; out: number; } /** * Curated price table. Keys are concrete model ids matching either * OpenRouter slugs or Anthropic SDK ids that the cost-optimal router can * choose. New models added via the registry sidecar should be reflected * here AS THEY ARE ADDED (no auto-sync); see ADR-149. */ export declare const MODEL_PRICES: Record; /** * Blended $/Mtok using the 1× input + 3× output ratio. Used by the KRR * trainer (scripts/train-bundled-krr.mjs and others) as the cost feature * the cost-optimal selector divides quality by. */ export declare function blendedPrice(modelId: string): number; /** * Compute USD spend for a single call. Cost = (input × $/Mtok_in + * output × $/Mtok_out) / 1_000_000. * * Returns 0 on missing usage and falls back to a conservative blended * estimate when the model is unknown — never returns undefined. */ export declare function costUsd(modelId: string | undefined, inputTokens: number | undefined, outputTokens: number | undefined): number; //# sourceMappingURL=model-prices.d.ts.map