{"record":{"id":"9565fb410ccdb910","repo":"n8n-io/n8n","slug":"text-to-speech-failed-response-base-resp-statu","errorCode":null,"errorMessage":"Text-to-speech failed: ${response.base_resp?.status_msg || 'Unknown error'}","messagePattern":"Text-to-speech failed: (.+?)","errorType":"exception","errorClass":"NodeOperationError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/nodes-langchain/nodes/vendors/MiniMax/actions/audio/tts.operation.ts","lineNumber":234,"sourceCode":"\t\taudio_setting: {\n\t\t\tformat: audioFormat,\n\t\t},\n\t};\n\n\tif (options.emotion) {\n\t\t(body.voice_setting as IDataObject).emotion = options.emotion;\n\t}\n\n\tif (options.languageBoost) {\n\t\tbody.language_boost = options.languageBoost;\n\t}\n\n\tconst response = (await apiRequest.call(this, 'POST', '/t2a_v2', {\n\t\tbody,\n\t})) as T2AResponse;\n\n\tif (response.base_resp?.status_code !== 0) {\n\t\tthrow new NodeOperationError(\n\t\t\tthis.getNode(),\n\t\t\t`Text-to-speech failed: ${response.base_resp?.status_msg || 'Unknown error'}`,\n\t\t);\n\t}\n\n\tconst audioData = response.data?.audio;\n\tif (!audioData) {\n\t\tthrow new NodeOperationError(this.getNode(), 'No audio data returned');\n\t}\n\n\tconst jsonData: IDataObject = {\n\t\taudioLength: response.extra_info?.audio_length,\n\t\taudioFormat: response.extra_info?.audio_format,\n\t\taudioSize: response.extra_info?.audio_size,\n\t\twordCount: response.extra_info?.word_count,\n\t\tusageCharacters: response.extra_info?.usage_characters,\n\t};\n","sourceCodeStart":216,"sourceCodeEnd":252,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/nodes-langchain/nodes/vendors/MiniMax/actions/audio/tts.operation.ts#L216-L252","documentation":"Thrown after the MiniMax TTS node POSTs to /t2a_v2 and the response's base_resp.status_code is anything other than 0. MiniMax signals API-level failures (as opposed to HTTP failures) with a non-zero status_code and a human-readable status_msg; this node mirrors status_msg into the error text, falling back to 'Unknown error' when the field is absent.","triggerScenarios":"Voice ID does not exist or is not enabled for the account; chosen emotion is unsupported for the selected voice; language_boost value is invalid for the model; input text triggers MiniMax content moderation; account is out of credits or the API key lacks TTS permission; request body shape rejected by a newer API revision.","commonSituations":"Hard-coded voice ID from docs that belongs to a different account tier; emotion set on a non-emotional voice; long text exceeding the per-request character cap; API key rotated but credentials not updated in n8n; rate/quota limit hit.","solutions":["Read the full status_msg in the thrown error — it is the upstream reason and usually names the exact problem.","Validate the voice ID against the account's enabled voices (MiniMax GET /voices or platform console).","Confirm the emotion option is compatible with the chosen voice; drop emotion and retry to isolate.","Check account quota/credits and API key scopes in the MiniMax console.","Shorten input text below the documented limit and retry to rule out length-related rejection."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Validate TTS inputs before calling /t2a_v2.\nconst SUPPORTED_LANG_BOOST = ['', 'Chinese', 'English', 'Japanese', 'Korean'] as const;\nfunction validateTtsInput(opts: { voiceId?: string; emotion?: string; languageBoost?: string; text?: string }) {\n  if (!opts.voiceId) return 'voiceId is required';\n  if (opts.text && opts.text.length > 1000) return `text length ${opts.text.length} exceeds the typical 1000-char limit`;\n  if (opts.languageBoost && !SUPPORTED_LANG_BOOST.includes(opts.languageBoost as never)) {\n    return `language_boost '${opts.languageBoost}' is not recognized`;\n  }\n  return null;\n}","typeGuard":"function isTtsSuccessResponse(r: unknown): r is { base_resp: { status_code: 0 }; data: { audio: string } } {\n  const b = (r as { base_resp?: { status_code?: number } })?.base_resp;\n  return !!b && b.status_code === 0 &&\n    typeof (r as { data?: { audio?: unknown } })?.data?.audio === 'string';\n}","tryCatchPattern":"let response: T2AResponse;\ntry {\n  response = (await apiRequest.call(this, 'POST', '/t2a_v2', { body })) as T2AResponse;\n} catch (e) {\n  throw new NodeOperationError(this.getNode(), `TTS request failed: ${(e as Error).message}`);\n}\nif (response.base_resp?.status_code !== 0) {\n  // expose the upstream status_msg verbatim\n  throw new NodeOperationError(\n    this.getNode(),\n    `Text-to-speech failed: ${response.base_resp?.status_msg || 'Unknown error'}`,\n  );\n}","preventionTips":["Cross-check the voice ID against the account's enabled voices before deploying.","Strip or whitelist emotion/language_boost values against MiniMax docs for the chosen model.","Keep input text under the documented character cap to avoid length-related rejections.","Surface upstream status_msg in your own error UI instead of swallowing it."],"tags":["minimax","tts","api-error","content-moderation"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}