Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mmx-cli",
"version": "1.0.7",
"version": "1.0.8",
"description": "CLI for the MiniMax AI Platform",
"type": "module",
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion src/client/endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function vlmEndpoint(baseUrl: string): string {
export function quotaEndpoint(baseUrl: string): string {
// Quota endpoint uses api subdomain
const host = baseUrl.includes('minimaxi.com') ? 'https://api.minimaxi.com' : 'https://api.minimax.io';
return `${host}/v1/api/openplatform/coding_plan/remains`;
return `${host}/v1/token_plan/remains`;
}

export function fileUploadEndpoint(baseUrl: string): string {
Expand Down
6 changes: 2 additions & 4 deletions src/output/quota-table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,11 @@ export function renderQuotaTable(models: QuotaModelRemain[], config: Config): vo
for (const m of models) {
console.log(boxLine(W, '├', '─', '┤', useColor));

const remaining = m.current_interval_usage_count;
const used = m.current_interval_usage_count;
const limit = m.current_interval_total_count;
const used = Math.max(0, limit - remaining);
const usedPct = limit > 0 ? Math.round((used / limit) * 100) : 0;
const weekRemaining = m.current_weekly_usage_count;
const weekUsed = m.current_weekly_usage_count;
const weekLimit = m.current_weekly_total_count;
const weekUsed = Math.max(0, weekLimit - weekRemaining);
const resets = formatDuration(m.remains_time, L.now);

const nameStr = m.model_name.padEnd(maxNameLen);
Expand Down
90 changes: 41 additions & 49 deletions test/fixtures/quota-response.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,53 +3,45 @@
"status_code": 0,
"status_msg": "success"
},
"data": {
"plan": "Max-Highspeed",
"period_start": "2025-08-01",
"period_end": "2025-09-01",
"models": [
{
"model": "MiniMax-M2.7-highspeed",
"used": 8241,
"limit": 15000,
"reset": "rolling 5h",
"unit": "requests"
},
{
"model": "speech-2.8-hd",
"used": 4300,
"limit": 19000,
"reset": "daily",
"unit": "characters"
},
{
"model": "image-01",
"used": 42,
"limit": 200,
"reset": "daily",
"unit": "images"
},
{
"model": "Hailuo-2.3",
"used": 1,
"limit": 3,
"reset": "daily",
"unit": "videos"
},
{
"model": "Hailuo-2.3-Fast",
"used": 0,
"limit": 3,
"reset": "daily",
"unit": "videos"
},
{
"model": "music-2.5",
"used": 2,
"limit": 7,
"reset": "daily",
"unit": "songs"
}
]
}
"model_remains": [
{
"model_name": "MiniMax-M*",
"start_time": 1776355200000,
"end_time": 1776373200000,
"remains_time": 7151954,
"current_interval_total_count": 1500,
"current_interval_usage_count": 228,
"current_weekly_total_count": 0,
"current_weekly_usage_count": 0,
"weekly_start_time": 1776009600000,
"weekly_end_time": 1776614400000,
"weekly_remains_time": 248351954
},
{
"model_name": "speech-hd",
"start_time": 1776355200000,
"end_time": 1776441600000,
"remains_time": 75551954,
"current_interval_total_count": 9000,
"current_interval_usage_count": 0,
"current_weekly_total_count": 63000,
"current_weekly_usage_count": 0,
"weekly_start_time": 1776009600000,
"weekly_end_time": 1776614400000,
"weekly_remains_time": 248351954
},
{
"model_name": "image-01",
"start_time": 1776355200000,
"end_time": 1776441600000,
"remains_time": 75551954,
"current_interval_total_count": 100,
"current_interval_usage_count": 0,
"current_weekly_total_count": 700,
"current_weekly_usage_count": 0,
"weekly_start_time": 1776009600000,
"weekly_end_time": 1776614400000,
"weekly_remains_time": 248351954
}
]
}
Loading