{"record":{"id":"b86338943df5c05a","repo":"BerriAI/litellm","slug":"no-audio-data-in-minimax-response-response-keys","errorCode":null,"errorMessage":"No audio data in MiniMax response. Response keys: {list(response_json.keys())}","messagePattern":"No audio data in MiniMax response\\. Response keys: (.+?)","errorType":"exception","errorClass":"MinimaxException","httpStatus":500,"severity":"error","filePath":"litellm/llms/minimax/text_to_speech/transformation.py","lineNumber":339,"sourceCode":"            # MiniMax returns audio in \"data\" field\n            data: Final = response_json.get(\"data\", {})\n\n            # Check if response contains a URL (output_format='url')\n            audio_url: Final = data.get(\"audio_url\", None)\n            if audio_url:\n                # If URL format is used, we need to fetch the audio from the URL\n                # For now, return a response indicating URL mode (TODO: fetch audio from URL)\n                raise MinimaxException(\n                    status_code=500,\n                    message=f\"URL output format is not yet supported. Use 'hex' format or fetch from URL: {audio_url}\",\n                    headers=dict(raw_response.headers),\n                )\n\n            # Get hex-encoded audio data\n            audio_hex: Final = data.get(\"audio\", \"\") or response_json.get(\"audio_file\", \"\")\n\n            if not audio_hex:\n                raise MinimaxException(\n                    status_code=500,\n                    message=f\"No audio data in MiniMax response. Response keys: {list(response_json.keys())}\",\n                    headers=dict(raw_response.headers),\n                )\n\n            # MiniMax returns hex-encoded audio by default\n            # Try hex decoding first, fall back to base64 if that fails\n            try:\n                audio_bytes = bytes.fromhex(audio_hex)\n            except ValueError:\n                # If hex decoding fails, try base64 (for older API versions)\n                try:\n                    audio_bytes = base64.b64decode(audio_hex)\n                except Exception as e:\n                    raise MinimaxException(\n                        status_code=500,\n                        message=f\"Failed to decode audio data: {e}\",\n                        headers=dict(raw_response.headers),","sourceCodeStart":321,"sourceCodeEnd":357,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/llms/minimax/text_to_speech/transformation.py#L321-L357","documentation":"Error \"No audio data in MiniMax response. Response keys: {list(response_json.keys())}\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/minimax/text_to_speech/transformation.py:339 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The MiniMax response had no audio data; check request parameters and response keys."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}