Skip to content

Never stop coding. Free MIT AI gateway: one endpoint, 375 providers (150+ free), 1,400+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 900+ contributors

fix(usage): add extensible CURRENCY_SYMBOLS mapping for deepseek currencies

Pham Quang Hoa7f0da3d0b2e6
diff --git a/src/app/(dashboard)/dashboard/usage/components/ProviderLimits/index.tsx b/src/app/(dashboard)/dashboard/usage/components/ProviderLimits/index.tsx
index 8f894e8a11..b7c638e28c 100644
--- a/src/app/(dashboard)/dashboard/usage/components/ProviderLimits/index.tsx
+++ b/src/app/(dashboard)/dashboard/usage/components/ProviderLimits/index.tsx
@@ -45,6 +45,17 @@ const PROVIDER_CONFIG = {
deepseek: { label: "DeepSeek", color: "#4D6BFE" },
};
+// Currency symbol mapping
+const CURRENCY_SYMBOLS: Record<string, string> = {
+ USD: "$",
+ CNY: "¥",
+ EUR: "€",
+ GBP: "£",
+ JPY: "¥",
+ KRW: "₩",
+ INR: "₹",
+};
+
const TIER_FILTERS = [
{ key: "all", labelKey: "tierAll" },
{ key: "enterprise", labelKey: "tierEnterprise" },
@@ -644,7 +655,7 @@ export default function ProviderLimits() {
className="text-[12px] font-bold tabular-nums"
style={{ color: colors.text }}
>
- {q.currency === "CNY" ? "¥" : q.currency === "USD" ? "$" : ""}
+ {CURRENCY_SYMBOLS[q.currency] ?? q.currency ?? ""}
{(q.creditCount ?? q.remaining).toLocaleString(undefined, {
minimumFractionDigits: 2,
maximumFractionDigits: 2,
diff --git a/src/app/(dashboard)/dashboard/usage/components/ProviderLimits/utils.tsx b/src/app/(dashboard)/dashboard/usage/components/ProviderLimits/utils.tsx
index 0a5ca5612e..7132256c4b 100644
--- a/src/app/(dashboard)/dashboard/usage/components/ProviderLimits/utils.tsx
+++ b/src/app/(dashboard)/dashboard/usage/components/ProviderLimits/utils.tsx
@@ -304,15 +304,17 @@ export function parseQuotaData(provider, data) {
case "deepseek":
// DeepSeek balance: credits-style display with currency
- // Handles both "credits" and "credits_usd"/"credits_cny" key formats
+ // Match any "credits" key with optional 3-letter currency suffix
if (data.quotas) {
Object.entries(data.quotas).forEach(([quotaKey, quota]: [string, any]) => {
- // Match credits_usd, credits_cny, or legacy credits
- if (/^credits(?:_usd|_cny)?$/.test(quotaKey)) {
+ // Match credits, credits_usd, credits_cny, credits_eur, etc.
+ const match = quotaKey.match(/^credits(?:_([a-z]{3}))?$/);
+ if (match) {
const remaining = Number(quota?.remaining ?? 0);
- const currency = quota?.currency ?? (quotaKey.includes("cny") ? "CNY" : "USD");
+ // Extract currency from key suffix or use quota.currency, fallback to USD
+ const currency = quota?.currency ?? (match[1] ? match[1].toUpperCase() : "USD");
normalizedQuotas.push({
- name: `${currency}`,
+ name: currency,
used: 0,
total: 0,
remaining,