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

  1. Log the full MiniMax response body to see base_resp.status_code and status_msg for the real cause
  2. Verify the MiniMax API key is valid and belongs to the correct group (intl vs cn endpoint)
  3. Check remaining quota/credits in the MiniMax console
  4. Confirm the TTS model and voice names are valid for your account tier
  5. 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

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


AI-assisted analysis of decolua/9router@90b52e06ff (2026-08-30). Data as JSON: /api/errors/816ae92fe74b5107. Report an issue: GitHub.