feat(usage): add Kimi and DeepSeek usage handlers

Wire /v1/usages for Kimi (OAuth + API key) and balance API for DeepSeek,
flag both providers with usage/usageApikey, and normalize their quotas
in the dashboard ProviderLimits parser.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
decolua
2026-07-29 18:09:35 +07:00
co-authored by Claude Fable 5
parent 65ac9b3cec
commit 6eaa9f8369
9 changed files with 814 additions and 1 deletions
@@ -492,6 +492,36 @@ export function parseQuotaData(provider, data) {
}
break;
case "kimi":
// Weekly / Ratelimit from /v1/usages. Prefer remainingPercentage only.
if (data.quotas) {
Object.entries(data.quotas).forEach(([name, quota]) => {
normalizedQuotas.push({
name,
used: quota.used || 0,
total: quota.total || 0,
resetAt: quota.resetAt || null,
remainingPercentage: quota.remainingPercentage,
});
});
}
break;
case "deepseek":
// Credit balance — remainingPercentage only (no absolute remaining).
if (data.quotas) {
Object.entries(data.quotas).forEach(([name, quota]) => {
normalizedQuotas.push({
name,
used: quota.used || 0,
total: quota.total || 0,
resetAt: quota.resetAt || null,
remainingPercentage: quota.remainingPercentage,
});
});
}
break;
default:
// Generic fallback for unknown providers
if (data.quotas) {