Skip to content

Commit c5bdfe7

Browse files
RyanLee-Devclaude
andcommitted
fix: migrate quota endpoints from www to api subdomain
The quota API has moved to api.minimaxi.com / api.minimax.io. Region detection was still using the old www subdomain, causing probe failures. Also skip env-key prompt when --api-key is explicitly provided. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c3241f3 commit c5bdfe7

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/client/endpoints.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ export function vlmEndpoint(baseUrl: string): string {
3939
}
4040

4141
export function quotaEndpoint(baseUrl: string): string {
42-
// Quota endpoint uses www subdomain, not api subdomain
43-
const host = baseUrl.includes('minimaxi.com') ? 'https://www.minimaxi.com' : 'https://www.minimax.io';
42+
// Quota endpoint uses api subdomain
43+
const host = baseUrl.includes('minimaxi.com') ? 'https://api.minimaxi.com' : 'https://api.minimax.io';
4444
return `${host}/v1/api/openplatform/coding_plan/remains`;
4545
}
4646

src/commands/auth/login.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export default defineCommand({
3232
],
3333
async run(config: Config, flags: GlobalFlags) {
3434
const envKey = process.env.MINIMAX_API_KEY;
35-
if (envKey) {
35+
if (envKey && !flags.apiKey) {
3636
const maskedEnvKey = maskToken(envKey);
3737
if (isInteractive({ nonInteractive: config.nonInteractive })) {
3838
const { confirm } = await import('@clack/prompts');

src/config/detect-region.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { readConfigFile, writeConfigFile } from './loader';
44
const QUOTA_PATH = '/v1/api/openplatform/coding_plan/remains';
55

66
function quotaUrl(region: Region): string {
7-
return REGIONS[region].replace('://api.', '://www.') + QUOTA_PATH;
7+
return REGIONS[region] + QUOTA_PATH;
88
}
99

1010
async function probeRegion(region: Region, apiKey: string, timeoutMs: number): Promise<boolean> {

0 commit comments

Comments
 (0)