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

feat(quota): xiaomi monthly cap + deepseek USD preset; researched plan tiers

diegosouzapw512e980a9e7a
diff --git a/src/lib/quota/planRegistry.ts b/src/lib/quota/planRegistry.ts
index ad6c3c246b..3bf5e86836 100644
--- a/src/lib/quota/planRegistry.ts
+++ b/src/lib/quota/planRegistry.ts
@@ -35,11 +35,21 @@ const KNOWN_PLANS: Record<string, KnownPlanShape> = {
},
minimax: {
provider: "minimax",
+ // MiniMax token plan (platform.minimax.io/docs/token-plan): monthly allowance
+ // enforced over 5h-rolling + weekly windows. Tiers (M3): Plus ~1.633B ($20),
+ // Max ~5.053B ($50), Ultra ~9.796B ($120). EPSILON = pick your tier in "Limite".
dimensions: [
{ unit: "tokens", window: "5h", limit: Number.EPSILON },
{ unit: "tokens", window: "weekly", limit: Number.EPSILON },
],
},
+ // DeepSeek is prepaid in USD — its balance API is already wired (deepseekQuotaFetcher)
+ // and shown on the quota page. fair-share supports the `usd` unit (COUNTABLE_UNITS),
+ // so set a USD budget here ("fixado por valor"); the proxy sums each key's USD cost.
+ deepseek: {
+ provider: "deepseek",
+ dimensions: [{ unit: "usd", window: "monthly", limit: Number.EPSILON }],
+ },
bailian: {
provider: "bailian",
dimensions: [
@@ -62,15 +72,13 @@ const KNOWN_PLANS: Record<string, KnownPlanShape> = {
{ unit: "tokens", window: "weekly", limit: Number.EPSILON },
],
},
- // Xiaomi MiMo exposes no upstream balance API. Default seeds the "lite" plan's
- // 4.1B-token weekly cap so the Wizard pre-fills a usable fair-share limit;
- // adjust in the "Limite" step to match the connection's actual plan.
+ // Xiaomi MiMo token plan (platform.xiaomimimo.com/token-plan) is a MONTHLY
+ // allowance with no balance API. Default seeds the "lite" plan's 4.1B-token
+ // monthly cap so the Wizard pre-fills a usable fair-share limit; adjust in the
+ // "Limite" step to match the connection's actual plan.
"xiaomi-mimo": {
provider: "xiaomi-mimo",
- dimensions: [
- { unit: "tokens", window: "5h", limit: Number.EPSILON },
- { unit: "tokens", window: "weekly", limit: 4_100_000_000 },
- ],
+ dimensions: [{ unit: "tokens", window: "monthly", limit: 4_100_000_000 }],
},
alibaba: {
provider: "alibaba",
diff --git a/tests/unit/quota-share-bugfixes-v388.test.ts b/tests/unit/quota-share-bugfixes-v388.test.ts
index 5374defad5..8c4ca1b48d 100644
--- a/tests/unit/quota-share-bugfixes-v388.test.ts
+++ b/tests/unit/quota-share-bugfixes-v388.test.ts
@@ -177,11 +177,23 @@ test("planRegistry seeds xiaomi-mimo (4.1B lite cap) and kimi-coding for manual
const xiaomi = getKnownPlan("xiaomi-mimo");
assert.ok(xiaomi, "xiaomi-mimo must have a known plan so the wizard pre-fills");
assert.ok(
- xiaomi!.dimensions.some((d) => d.unit === "tokens" && d.window === "weekly" && d.limit === 4_100_000_000),
- "xiaomi-mimo must seed the 4.1B-token weekly lite cap"
+ xiaomi!.dimensions.some((d) => d.unit === "tokens" && d.window === "monthly" && d.limit === 4_100_000_000),
+ "xiaomi-mimo must seed the 4.1B-token monthly lite cap"
);
const kimiCoding = getKnownPlan("kimi-coding");
assert.ok(kimiCoding, "kimi-coding (the coding-plan slug) must have a known plan entry");
+ // claude (Claude Code) is percent-based like codex.
+ const claude = getKnownPlan("claude");
+ assert.ok(
+ claude && claude.dimensions.some((d) => d.unit === "percent"),
+ "claude must seed a percent plan preset"
+ );
+ // deepseek is prepaid USD → set the fair-share limit by USD value.
+ const deepseek = getKnownPlan("deepseek");
+ assert.ok(
+ deepseek && deepseek.dimensions.some((d) => d.unit === "usd"),
+ "deepseek must seed a usd (dollar-value) plan preset"
+ );
});
// ── i18n parity for every new key ────────────────────────────────────────────