Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

fix rounding

Gergő Móricz324b4e2e1e2a
diff --git a/apps/api/src/lib/extract/usage/llm-cost.ts b/apps/api/src/lib/extract/usage/llm-cost.ts
index 784a5749c..acac70be0 100644
--- a/apps/api/src/lib/extract/usage/llm-cost.ts
+++ b/apps/api/src/lib/extract/usage/llm-cost.ts
@@ -13,7 +13,7 @@ const tokenPerCharacter = 0.5;
const baseTokenCost = 300;
export function calculateThinkingCost(costTracking: CostTracking): number {
- return costTracking.toJSON().totalCost * 267000;
+ return Math.ceil(costTracking.toJSON().totalCost * 267000);
}
export function calculateFinalResultCost(data: any): number {