diff --git a/cost.ts b/cost.ts index 22edc97..da02e0c 100644 --- a/cost.ts +++ b/cost.ts @@ -28,7 +28,7 @@ export function calculateCost(model: string, usage?: Usage): number | null { if (!usage) return null; const { prompt_tokens = 0, completion_tokens = 0, prompt_tokens_details = { cached_tokens: 0 } } = usage; - const cost = MODEL_COSTS[model] || MODEL_COSTS["default"]; + const cost = MODEL_COSTS[model.toLowerCase()] || MODEL_COSTS["default"]; let inputCost = 0; let cachedCost = 0; diff --git a/proxy.ts b/proxy.ts index ef6f063..6d7598f 100644 --- a/proxy.ts +++ b/proxy.ts @@ -163,7 +163,7 @@ const server = http.createServer(async (req, res) => { timestamp: new Date(), request_method: method, request_path: path, - model: requestJson?.model || "default", + model: (requestJson?.model || "default").toLowerCase(), completion_tokens: usage.completion_tokens || null, prompt_tokens: usage.prompt_tokens || null, total_tokens: usage.total_tokens || null,