From d4bd755e60178f21e892fa1d5e049e442ae00bd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Barreiro?= <52393857+BarreiroT@users.noreply.github.com> Date: Sun, 27 Apr 2025 08:03:04 +0200 Subject: [PATCH] Set the default output cost (#3079) --- .changeset/twenty-comics-enjoy.md | 5 +++++ src/utils/cost.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/twenty-comics-enjoy.md diff --git a/.changeset/twenty-comics-enjoy.md b/.changeset/twenty-comics-enjoy.md new file mode 100644 index 00000000..fce250e4 --- /dev/null +++ b/.changeset/twenty-comics-enjoy.md @@ -0,0 +1,5 @@ +--- +"claude-dev": patch +--- + +fix cost calculation diff --git a/src/utils/cost.ts b/src/utils/cost.ts index facf788e..b14957d4 100644 --- a/src/utils/cost.ts +++ b/src/utils/cost.ts @@ -27,7 +27,7 @@ function calculateApiCostInternal( } // Determine effective output price - let effectiveOutputPrice = 0 + let effectiveOutputPrice = modelInfo.outputPrice || 0 // Check if thinking budget was used and has a specific price if (usedThinkingBudget && modelInfo.thinkingConfig?.outputPrice !== undefined) { effectiveOutputPrice = modelInfo.thinkingConfig.outputPrice