BerriAI/litellm · error · MinimaxException

Failed to parse MiniMax response

Error message

Failed to parse MiniMax response: {e}

What it means

Error "Failed to parse MiniMax response: {e}" thrown in BerriAI/litellm.

Solutions

  1. Log the raw MiniMax response body; handle non-JSON responses and check the wrapped parse error {e}.

When it happens

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

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/95532ce9c03b74a1. Report an issue: GitHub.

Appendix: source

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

            # We need to create a response that contains the decoded audio bytes
            # Remove gzip encoding headers to avoid decompression issues
            clean_headers: Final = dict(raw_response.headers)
            clean_headers.pop("content-encoding", None)
            clean_headers.pop("transfer-encoding", None)
            clean_headers["content-length"] = str(len(audio_bytes))

            # Create a new response object with the binary content
            binary_response: Final = httpx.Response(
                status_code=200,
                headers=clean_headers,
                content=audio_bytes,
                request=raw_response.request,
            )

            return HttpxBinaryResponseContent(binary_response)

        except json.JSONDecodeError as e:
            raise MinimaxException(
                status_code=500,
                message=f"Failed to parse MiniMax response: {e}",
                headers=dict(raw_response.headers),
            )
        except Exception as e:
            if isinstance(e, MinimaxException):
                raise
            raise MinimaxException(
                status_code=500,
                message=f"Error processing MiniMax response: {e}",
                headers=dict(raw_response.headers),
            )

    def get_complete_url(
        self,
        model: str,
        api_base: str | None,
        litellm_params: dict,

View on GitHub (pinned to 77b7c6c40c)