accurate pricing displayed when BYOK is used for openrouter and cline providers (#4466)
Co-authored-by: Cline Evaluation <cline@example.com>
This commit is contained in:
1 parent
ae076e2506
commit
6f5ff1b407
2 files changed
+2
-2
No files matched your search
@@ -75,7 +75,7 @@ export class ClineHandler implements ApiHandler {
|
||||
|
||||
if (!didOutputUsage && chunk.usage) {
|
||||
// @ts-ignore-next-line
|
||||
let totalCost = chunk.usage.cost || 0
|
||||
let totalCost = (chunk.usage.cost || 0) + (chunk.usage.cost_details?.upstream_inference_cost || 0)
|
||||
const modelId = this.getModel().id
|
||||
const provider = modelId.split("/")[0]
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ export class OpenRouterHandler implements ApiHandler {
|
||||
inputTokens: chunk.usage.prompt_tokens || 0,
|
||||
outputTokens: chunk.usage.completion_tokens || 0,
|
||||
// @ts-ignore-next-line
|
||||
totalCost: chunk.usage.cost || 0,
|
||||
totalCost: (chunk.usage.cost || 0) + (chunk.usage.cost_details?.upstream_inference_cost || 0),
|
||||
}
|
||||
didOutputUsage = true
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user