From 4f30fb3824cbc8d8e56e29a997bd677ed7bea8ad Mon Sep 17 00:00:00 2001 From: Fabio RItzel Borges <38725315+fworks-tech@users.noreply.github.com> Date: Thu, 17 Sep 2026 15:31:05 -0300 Subject: [PATCH] fix(chat): switch to glm-5.3-flash as mimo-v2.5 is retired mimo-v2.5 is no longer in the OpenCode Go model list, and mimo-v2.5-free on zen/v1 rejects server calls with FreeTierError (403). The router fails inconsistently for mimo-v2.5 (works from some edges, FreeTierError from Vercel egress). Switches to glm-5.3-flash, verified via direct API call including tool calling. --- src/app/api/chat/route.ts | 4 ++-- src/lib/abuse/cost.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/api/chat/route.ts b/src/app/api/chat/route.ts index ee9323b..ec667cb 100644 --- a/src/app/api/chat/route.ts +++ b/src/app/api/chat/route.ts @@ -40,14 +40,14 @@ export const maxDuration = 60; const zen = (sessionId: string) => createOpenAICompatible({ name: 'zen', - baseURL: 'https://opencode.ai/zen/v1', + baseURL: 'https://opencode.ai/zen/go/v1', headers: { Authorization: `Bearer ${process.env.OPENCODE_API_KEY}`, 'x-opencode-session': sessionId, }, }); -const MODEL_ID = 'mimo-v2.5-free'; +const MODEL_ID = 'glm-5.3-flash'; const model = (sessionId: string) => zen(sessionId).chatModel(MODEL_ID); diff --git a/src/lib/abuse/cost.ts b/src/lib/abuse/cost.ts index f782403..e4112b7 100644 --- a/src/lib/abuse/cost.ts +++ b/src/lib/abuse/cost.ts @@ -8,7 +8,7 @@ export const MAX_TOKENS_PER_REQUEST = 4000; const MAX_COST_PER_HOUR_USD = 0.5; // ~$0.50/hour budget -const TOKEN_COST_PER_1M = 0.28; // mimo-v2.5 on OpenCode Go +const TOKEN_COST_PER_1M = 0.28; // glm-5.3-flash on OpenCode Go (conservative upper bound) const USAGE_WINDOW_MS = 60 * 60 * 1000; // 1 hour const CLEANUP_INTERVAL_MS = 300_000; // 5 min