{"record":{"id":"53fba0eef95f2195","repo":"harry0703/MoneyPrinterTurbo","slug":"minimax-get-voice-failed-status-message","errorCode":null,"errorMessage":"MiniMax get_voice failed: {status_message}","messagePattern":"MiniMax get_voice failed: (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"app/services/voice.py","lineNumber":1424,"sourceCode":"            \"Content-Type\": \"application/json\",\n        },\n        timeout=30,\n    )\n    if response.status_code != 200:\n        raise RuntimeError(\n            f\"MiniMax get_voice failed with status {response.status_code}: \"\n            f\"{response.text[:200]}\"\n        )\n\n    try:\n        body = response.json()\n    except ValueError as exc:\n        raise RuntimeError(\"MiniMax get_voice returned invalid JSON\") from exc\n\n    base_resp = body.get(\"base_resp\") or {}\n    if base_resp.get(\"status_code\") not in {0, \"0\"}:\n        status_message = str(base_resp.get(\"status_msg\") or \"unknown error\")\n        raise RuntimeError(f\"MiniMax get_voice failed: {status_message}\")\n\n    catalog = []\n    seen_voice_ids = set()\n    response_groups = (\n        (\"system\", \"system_voice\"),\n        (\"voice_cloning\", \"voice_cloning\"),\n        (\"voice_generation\", \"voice_generation\"),\n    )\n    for normalized_type, response_key in response_groups:\n        for item in body.get(response_key) or []:\n            voice_id = str(item.get(\"voice_id\") or \"\").strip()\n            if not voice_id or voice_id in seen_voice_ids:\n                continue\n            seen_voice_ids.add(voice_id)\n            catalog.append(\n                {\n                    \"voice_id\": voice_id,\n                    \"voice_name\": str(item.get(\"voice_name\") or voice_id).strip(),","sourceCodeStart":1406,"sourceCodeEnd":1442,"githubUrl":"https://github.com/harry0703/MoneyPrinterTurbo/blob/1f9f19c2021a68d04df228f33e9099a0c947f6f8/app/services/voice.py#L1406-L1442","documentation":"MiniMax API convention: even on HTTP 200, the body carries base_resp.status_code, where non-zero signals an application-level error. This error wraps base_resp.status_msg (or 'unknown error') when status_code is not 0/'0'.","triggerScenarios":"Calling get_voice with a key that lacks permission for the requested voice_type; upstream business errors such as invalid voice_type, quota exhaustion, or account restrictions returned inside base_resp.","commonSituations":"Free-tier key querying voice_cloning/voice_generation it has no access to; account out of quota; MiniMax changing status codes for deprecated voice types.","solutions":["Read the embedded status_msg — MiniMax's own business error text names the problem.","For permission errors, use voice_type='system' or upgrade the account's plan.","For quota errors, wait/refill quota and retry.","Verify voice_type matches an access level the key supports."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    voices = list_minimax_voices(voice_type=vt)\nexcept RuntimeError as exc:\n    # message carries MiniMax base_resp.status_msg verbatim\n    show_user_error(str(exc))  # e.g. quota/permission text from upstream\n    return []","preventionTips":["Match voice_type to what the account has access to (system is the safest default).","Monitor quota before batch voice-listing operations."],"tags":["minimax","tts","api","business-error"],"backgroundTag":null,"analyzedSha":"1f9f19c2021a68d04df228f33e9099a0c947f6f8","analyzedAt":"2026-08-14T19:41:05.568Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}