Skip to content

Commit f01ff17

Browse files
authored
Merge pull request #104 from MiniMax-AI/fix/quota-endpoint
fix: use correct token_plan/remains endpoint
2 parents 813ff4c + a4bbafc commit f01ff17

4 files changed

Lines changed: 45 additions & 55 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mmx-cli",
3-
"version": "1.0.7",
3+
"version": "1.0.8",
44
"description": "CLI for the MiniMax AI Platform",
55
"type": "module",
66
"engines": {

src/client/endpoints.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export function vlmEndpoint(baseUrl: string): string {
4141
export function quotaEndpoint(baseUrl: string): string {
4242
// Quota endpoint uses api subdomain
4343
const host = baseUrl.includes('minimaxi.com') ? 'https://api.minimaxi.com' : 'https://api.minimax.io';
44-
return `${host}/v1/api/openplatform/coding_plan/remains`;
44+
return `${host}/v1/token_plan/remains`;
4545
}
4646

4747
export function fileUploadEndpoint(baseUrl: string): string {

src/output/quota-table.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,11 @@ export function renderQuotaTable(models: QuotaModelRemain[], config: Config): vo
114114
for (const m of models) {
115115
console.log(boxLine(W, '├', '─', '┤', useColor));
116116

117-
const remaining = m.current_interval_usage_count;
117+
const used = m.current_interval_usage_count;
118118
const limit = m.current_interval_total_count;
119-
const used = Math.max(0, limit - remaining);
120119
const usedPct = limit > 0 ? Math.round((used / limit) * 100) : 0;
121-
const weekRemaining = m.current_weekly_usage_count;
120+
const weekUsed = m.current_weekly_usage_count;
122121
const weekLimit = m.current_weekly_total_count;
123-
const weekUsed = Math.max(0, weekLimit - weekRemaining);
124122
const resets = formatDuration(m.remains_time, L.now);
125123

126124
const nameStr = m.model_name.padEnd(maxNameLen);

test/fixtures/quota-response.json

Lines changed: 41 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -3,53 +3,45 @@
33
"status_code": 0,
44
"status_msg": "success"
55
},
6-
"data": {
7-
"plan": "Max-Highspeed",
8-
"period_start": "2025-08-01",
9-
"period_end": "2025-09-01",
10-
"models": [
11-
{
12-
"model": "MiniMax-M2.7-highspeed",
13-
"used": 8241,
14-
"limit": 15000,
15-
"reset": "rolling 5h",
16-
"unit": "requests"
17-
},
18-
{
19-
"model": "speech-2.8-hd",
20-
"used": 4300,
21-
"limit": 19000,
22-
"reset": "daily",
23-
"unit": "characters"
24-
},
25-
{
26-
"model": "image-01",
27-
"used": 42,
28-
"limit": 200,
29-
"reset": "daily",
30-
"unit": "images"
31-
},
32-
{
33-
"model": "Hailuo-2.3",
34-
"used": 1,
35-
"limit": 3,
36-
"reset": "daily",
37-
"unit": "videos"
38-
},
39-
{
40-
"model": "Hailuo-2.3-Fast",
41-
"used": 0,
42-
"limit": 3,
43-
"reset": "daily",
44-
"unit": "videos"
45-
},
46-
{
47-
"model": "music-2.5",
48-
"used": 2,
49-
"limit": 7,
50-
"reset": "daily",
51-
"unit": "songs"
52-
}
53-
]
54-
}
6+
"model_remains": [
7+
{
8+
"model_name": "MiniMax-M*",
9+
"start_time": 1776355200000,
10+
"end_time": 1776373200000,
11+
"remains_time": 7151954,
12+
"current_interval_total_count": 1500,
13+
"current_interval_usage_count": 228,
14+
"current_weekly_total_count": 0,
15+
"current_weekly_usage_count": 0,
16+
"weekly_start_time": 1776009600000,
17+
"weekly_end_time": 1776614400000,
18+
"weekly_remains_time": 248351954
19+
},
20+
{
21+
"model_name": "speech-hd",
22+
"start_time": 1776355200000,
23+
"end_time": 1776441600000,
24+
"remains_time": 75551954,
25+
"current_interval_total_count": 9000,
26+
"current_interval_usage_count": 0,
27+
"current_weekly_total_count": 63000,
28+
"current_weekly_usage_count": 0,
29+
"weekly_start_time": 1776009600000,
30+
"weekly_end_time": 1776614400000,
31+
"weekly_remains_time": 248351954
32+
},
33+
{
34+
"model_name": "image-01",
35+
"start_time": 1776355200000,
36+
"end_time": 1776441600000,
37+
"remains_time": 75551954,
38+
"current_interval_total_count": 100,
39+
"current_interval_usage_count": 0,
40+
"current_weekly_total_count": 700,
41+
"current_weekly_usage_count": 0,
42+
"weekly_start_time": 1776009600000,
43+
"weekly_end_time": 1776614400000,
44+
"weekly_remains_time": 248351954
45+
}
46+
]
5547
}

0 commit comments

Comments
 (0)