n8n-io/n8n · error · NodeOperationError

Text-to-speech failed: ${response.base_resp?.status_msg || '

Error message

Text-to-speech failed: ${response.base_resp?.status_msg || 'Unknown error'}

What it means

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.

Source

Thrown at packages/@n8n/nodes-langchain/nodes/vendors/MiniMax/actions/audio/tts.operation.ts:234

		audio_setting: {
			format: audioFormat,
		},
	};

	if (options.emotion) {
		(body.voice_setting as IDataObject).emotion = options.emotion;
	}

	if (options.languageBoost) {
		body.language_boost = options.languageBoost;
	}

	const response = (await apiRequest.call(this, 'POST', '/t2a_v2', {
		body,
	})) as T2AResponse;

	if (response.base_resp?.status_code !== 0) {
		throw new NodeOperationError(
			this.getNode(),
			`Text-to-speech failed: ${response.base_resp?.status_msg || 'Unknown error'}`,
		);
	}

	const audioData = response.data?.audio;
	if (!audioData) {
		throw new NodeOperationError(this.getNode(), 'No audio data returned');
	}

	const jsonData: IDataObject = {
		audioLength: response.extra_info?.audio_length,
		audioFormat: response.extra_info?.audio_format,
		audioSize: response.extra_info?.audio_size,
		wordCount: response.extra_info?.word_count,
		usageCharacters: response.extra_info?.usage_characters,
	};

View on GitHub (pinned to 5ac6606e81)

Solutions

  1. Read the full status_msg in the thrown error — it is the upstream reason and usually names the exact problem.
  2. Validate the voice ID against the account's enabled voices (MiniMax GET /voices or platform console).
  3. Confirm the emotion option is compatible with the chosen voice; drop emotion and retry to isolate.
  4. Check account quota/credits and API key scopes in the MiniMax console.
  5. Shorten input text below the documented limit and retry to rule out length-related rejection.
Defensive patterns

Strategy: validation

Validate before calling

// Validate TTS inputs before calling /t2a_v2.
const SUPPORTED_LANG_BOOST = ['', 'Chinese', 'English', 'Japanese', 'Korean'] as const;
function validateTtsInput(opts: { voiceId?: string; emotion?: string; languageBoost?: string; text?: string }) {
  if (!opts.voiceId) return 'voiceId is required';
  if (opts.text && opts.text.length > 1000) return `text length ${opts.text.length} exceeds the typical 1000-char limit`;
  if (opts.languageBoost && !SUPPORTED_LANG_BOOST.includes(opts.languageBoost as never)) {
    return `language_boost '${opts.languageBoost}' is not recognized`;
  }
  return null;
}

Type guard

function isTtsSuccessResponse(r: unknown): r is { base_resp: { status_code: 0 }; data: { audio: string } } {
  const b = (r as { base_resp?: { status_code?: number } })?.base_resp;
  return !!b && b.status_code === 0 &&
    typeof (r as { data?: { audio?: unknown } })?.data?.audio === 'string';
}

Try / catch

let response: T2AResponse;
try {
  response = (await apiRequest.call(this, 'POST', '/t2a_v2', { body })) as T2AResponse;
} catch (e) {
  throw new NodeOperationError(this.getNode(), `TTS request failed: ${(e as Error).message}`);
}
if (response.base_resp?.status_code !== 0) {
  // expose the upstream status_msg verbatim
  throw new NodeOperationError(
    this.getNode(),
    `Text-to-speech failed: ${response.base_resp?.status_msg || 'Unknown error'}`,
  );
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12). Data as JSON: /api/errors/9565fb410ccdb910. Report an issue: GitHub.