From b3fd63b5949da3798b1dbfa6827655e649ea7f04 Mon Sep 17 00:00:00 2001 From: orfelorfel23 Date: Fri, 28 Aug 2026 15:21:35 +0200 Subject: [PATCH] Fix POE and MiniMax API response parsing --- src/services/providers.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/services/providers.ts b/src/services/providers.ts index f9067d2..c1d4321 100644 --- a/src/services/providers.ts +++ b/src/services/providers.ts @@ -37,8 +37,8 @@ export async function fetchPoeQuota(): Promise { // POE logic: 75000 daily points is standard. We might need to adjust based on actual API payload. // Assuming response has: { available: number } - const available = res.data.available || 0; - const total = 75000; + const available = res.data.current_point_balance || 0; + const total = 2575000; const used = total - available > 0 ? total - available : 0; const percentage = (used / total) * 100; @@ -57,10 +57,10 @@ export async function fetchMinimaxQuota(): Promise { } }); - // Assuming response has { used_quota: number, total_quota: number } - const used = res.data.used_quota || 0; - const total = res.data.total_quota || 100; - const percentage = (used / total) * 100; + const remains = res.data.model_remains?.find((r: any) => r.model_name === 'general'); + const total = 100; + const percentage = remains ? (100 - remains.current_weekly_remaining_percent) : 0; + const used = percentage; return { provider: 'MiniMax', used, total, percentage }; } catch (error: any) {