diff --git a/apps/api/src/services/chat_manager.py b/apps/api/src/services/chat_manager.py index 37a8f298..7ab341f0 100644 --- a/apps/api/src/services/chat_manager.py +++ b/apps/api/src/services/chat_manager.py @@ -105,8 +105,8 @@ class ChatManager: logger.warning("openclaw_gemini_monthly_limit_reached", current_usd=current_cost, limit_usd=MONTHLY_LIMIT_USD) return f"🔴 OpenClaw 本月 Gemini 用量已達上限 ${MONTHLY_LIMIT_USD} USD(已用 ${current_cost:.4f})" - # Gemini 2.0 Flash: 快速、便宜 (與 models.json 對齊) - model = "gemini-2.0-flash" + # Gemini 2.0 Flash-Lite: 最便宜 (2026-04-03 老闆指示) + model = "gemini-2.0-flash-lite" try: async with httpx.AsyncClient(timeout=30.0) as client: resp = await client.post( @@ -125,8 +125,8 @@ class ChatManager: usage = data.get("usageMetadata", {}) in_tok = usage.get("promptTokenCount", 0) out_tok = usage.get("candidatesTokenCount", 0) - # Gemini 2.0 Flash: Input $0.10/1M, Output $0.40/1M - cost = (in_tok * 0.0000001) + (out_tok * 0.0000004) + # Gemini 2.0 Flash-Lite: Input $0.075/1M, Output $0.30/1M + cost = (in_tok * 0.000000075) + (out_tok * 0.0000003) new_total = current_cost + cost try: