BerriAI/litellm · error · MinimaxException

MiniMax TTS error: {error_detail}

Error message

MiniMax TTS error: {error_detail}

What it means

Error "MiniMax TTS error: {error_detail}" thrown in BerriAI/litellm.

Source

Thrown at litellm/llms/minimax/text_to_speech/transformation.py:314

        from litellm.types.llms.openai import HttpxBinaryResponseContent

        try:
            # Parse JSON response
            response_json: Final = raw_response.json()

            # MiniMax API response format check
            # The API can return different structures:
            # 1. {"data": {"audio": "..."}, "status": 0, ...} for HTTP endpoint
            # 2. {"base_resp": {"status_code": 0, ...}, "audio_file": "..."} for older versions

            # Check for errors - MiniMax uses "status" field in HTTP endpoint response
            # status: 0 = success, 2 = invalid api key, etc.
            status: Final = response_json.get("status")
            if status is not None and status != 0:
                ced: Final = response_json.get("ced", "Unknown error")
                error_detail: Final = ced if ced else f"API returned status {status}"
                raise MinimaxException(
                    status_code=raw_response.status_code,
                    message=f"MiniMax TTS error: {error_detail}",
                    headers=dict(raw_response.headers),
                )

            # Extract audio data
            # MiniMax returns audio in "data" field
            data: Final = response_json.get("data", {})

            # Check if response contains a URL (output_format='url')
            audio_url: Final = data.get("audio_url", None)
            if audio_url:
                # If URL format is used, we need to fetch the audio from the URL
                # For now, return a response indicating URL mode (TODO: fetch audio from URL)
                raise MinimaxException(
                    status_code=500,
                    message=f"URL output format is not yet supported. Use 'hex' format or fetch from URL: {audio_url}",
                    headers=dict(raw_response.headers),

View on GitHub (pinned to 6c2dcb801b)

Solutions

  1. Inspect the MiniMax TTS error detail.

When it happens

Trigger: Thrown at litellm/llms/minimax/text_to_speech/transformation.py:314 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BerriAI/litellm@6c2dcb801b (2026-08-15). Data as JSON: /api/errors/ba984e8b7161ca93. Report an issue: GitHub.