Files
brain/tools/cost-pricing.mjs
T

32 lines
1.2 KiB
JavaScript

/**
* Cost pricing constants for Anthropic models (USD per token).
*
* Sources:
* - Opus 4.7: $15/Mtok input, $75/Mtok output
* - Sonnet 4.6: $3/Mtok input, $15/Mtok output
*
* Used by `cost-aggregator.mjs` to convert token counts to USD.
*
* NB: reviewer_subagent_usd / reviewer_direct_fallback_usd are already in USD
* (subagent has its own cost computed elsewhere) — pricing not applied.
*
* Spec: docs/superpowers/specs/2026-05-24-llm-first-router-overhaul-design.md §12.
*/
export const PRICING = Object.freeze({
sonnet: Object.freeze({
input: 3 / 1_000_000,
output: 15 / 1_000_000,
}),
opus: Object.freeze({
input: 15 / 1_000_000,
output: 75 / 1_000_000,
}),
});
// Оценочная средняя стоимость одного вызова per-tool LLM-судьи (Sonnet, ~600 in /
// ~10 out токенов на короткий YES/NO-промпт). Используется для derive
// task_cost.judge_spend_usd из числа вызовов судьи (judge_calls). Уточнить, когда
// появится по-вызовный учёт токенов судьи.
export const JUDGE_PER_CALL_USD = 600 * PRICING.sonnet.input + 10 * PRICING.sonnet.output;