Fix POE and MiniMax API response parsing

This commit is contained in:
Jannik committed 2026-08-28 15:21:35 +02:00
1 parent faa4013818
commit b3fd63b594
1 file changed
+6 -6
+6 -6
View File
@@ -37,8 +37,8 @@ export async function fetchPoeQuota(): Promise<QuotaEntry> {
// 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<QuotaEntry> {
}
});
// 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) {