{"record":{"id":"97dcc336801de02e","repo":"BerriAI/litellm","slug":"no-audiocontent-in-vertex-ai-tts-response","errorCode":null,"errorMessage":"No audioContent in Vertex AI TTS response","messagePattern":"No audioContent in Vertex AI TTS response","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/vertex_ai/text_to_speech/transformation.py","lineNumber":458,"sourceCode":"        model: str,\n        raw_response: httpx.Response,\n        logging_obj: \"LiteLLMLoggingObj\",\n    ) -> \"HttpxBinaryResponseContent\":\n        \"\"\"\n        Transform Vertex AI TTS response to standard format\n\n        Vertex AI returns JSON with base64-encoded audio content.\n        We decode it and return as HttpxBinaryResponseContent.\n        \"\"\"\n        from litellm.types.llms.openai import HttpxBinaryResponseContent\n\n        # Parse JSON response\n        _json_response: Final = raw_response.json()\n\n        # Get base64-encoded audio content\n        response_content: Final = _json_response.get(\"audioContent\")\n        if not response_content:\n            raise ValueError(\"No audioContent in Vertex AI TTS response\")\n\n        # Decode base64 to get binary content\n        binary_data: Final = base64.b64decode(response_content)\n\n        # Create an httpx.Response object with the binary data\n        response: Final = httpx.Response(\n            status_code=200,\n            content=binary_data,\n        )\n\n        # Initialize the HttpxBinaryResponseContent instance\n        return HttpxBinaryResponseContent(response)\n","sourceCodeStart":440,"sourceCodeEnd":471,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/vertex_ai/text_to_speech/transformation.py#L440-L471","documentation":"Raised in transform_response when the Vertex AI TTS JSON payload lacks audioContent — e.g. the API returned an error object or an unexpected schema. There is no audio to decode into HttpxBinaryResponseContent, so response transformation fails.","triggerScenarios":"Thrown at litellm/llms/vertex_ai/text_to_speech/transformation.py:458 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the raw response for an upstream error; a missing audioContent usually means the synthesis failed server-side.","Retry, and verify the request parameters (voice, language, audio encoding) are valid for the chosen model."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}