decolua/9router · error · Error
MiniMax TTS upstream error
Error message
MiniMax TTS upstream error
What it means
9Router's MiniMax TTS provider throws this when the upstream MiniMax HTTP response is OK (200) but the JSON body's base_resp.status_code is non-zero, meaning MiniMax rejected the request at the application level. The status_msg field from MiniMax is preferred but if empty this generic message is thrown. It signals an API-level refusal (auth, quota, invalid params) rather than a transport failure.
Source
Thrown at open-sse/handlers/ttsProviders/minimax.js:52
},
}),
});
const rawText = await res.text();
let data = {};
if (rawText) {
try { data = JSON.parse(rawText); } catch { data = {}; }
}
const baseResp = data.base_resp || data.baseResp || {};
const statusCode = Number(baseResp.status_code ?? baseResp.statusCode ?? 0);
const statusMessage = baseResp.status_msg || baseResp.statusMsg || data.message || "";
if (!res.ok) {
throw new Error(statusMessage || rawText || `MiniMax TTS error (${res.status})`);
}
if (statusCode !== 0) {
throw new Error(statusMessage || "MiniMax TTS upstream error");
}
return {
base64: hexToBase64(data.data?.audio),
format: data.extra_info?.audio_format || data.extraInfo?.audioFormat || "mp3",
};
}
View on GitHub (pinned to 90b52e06ff)
Solutions
- Log the full MiniMax response body to see base_resp.status_code and status_msg for the real cause
- Verify the MiniMax API key is valid and belongs to the correct group (intl vs cn endpoint)
- Check remaining quota/credits in the MiniMax console
- Confirm the TTS model and voice names are valid for your account tier
- If status_msg was empty, patch error handling to include the numeric status_code in the thrown message
Defensive patterns
Strategy: validation
Validate before calling
const status = body?.base_resp?.status_code ?? body?.baseResp?.statusCode;
if (typeof status === "number" && status !== 0) {
throw new Error(`MiniMax TTS rejected: ${status} ${body?.base_resp?.status_msg ?? ""}`);
} Type guard
function hasMiniMaxAudio(d) {
return typeof d?.data?.audio === "string" && d.data.audio.length > 0;
} Try / catch
try {
const out = await minimaxTts(text, opts);
} catch (e) {
if (/MiniMax/.test(e.message)) {
logger.warn("minimax tts rejected", e.message);
// surface base_resp.status_msg / switch provider
} else throw e;
} Prevention
- Validate the MiniMax key and group/endpoint pairing (intl vs cn) before routing TTS there
- Monitor quota in the MiniMax console and alert before exhaustion
- Include base_resp.status_code in logs for every TTS call
- Configure a fallback TTS provider
When it happens
Trigger: Calling the TTS endpoint with a MiniMax API key that is invalid/expired (status 1000/1004), exceeding group quota, or an invalid model/voice — any response where HTTP 200 is returned but baseResp.statusCode !== 0 and status_msg is empty.
Common situations: Developers using a MiniMax international key against the China endpoint (or vice versa), exhausted free trial credits, or a group_id mismatch in the configured base URL.
Related errors
- Upstream error (${res.status})
- ElevenLabs API key required
- No Gemini API key configured
- ${provider} API key required
- MiniMax TTS returned no audio
AI-assisted analysis of decolua/9router@90b52e06ff (2026-08-30).
Data as JSON: /api/errors/816ae92fe74b5107.
Report an issue: GitHub.