BerriAI/litellm · error · ValueError
RunwayML TTS audio URL is not a string: {audio_url}
Error message
RunwayML TTS audio URL is not a string: {audio_url} What it means
Type guard after RunwayML TTS polling: output contained an audio URL candidate, but it is not a string (e.g. a dict/object URL), so it cannot be used for the download request; the offending value is echoed.
Source
Thrown at litellm/llms/runwayml/text_to_speech/transformation.py:497
task_id=task_id,
api_base=self.DEFAULT_BASE_URL,
headers=poll_headers,
timeout_secs=RUNWAYML_POLLING_TIMEOUT,
)
# Get the completed task data
task_data: Final = polled_response.json()
verbose_logger.debug("RunwayML TTS polling complete, downloading audio")
# Get audio URL from output
output: Final = task_data.get("output", [])
if not output or not isinstance(output, list) or len(output) == 0:
raise ValueError("RunwayML TTS response missing audio URL in output")
audio_url: Final = output[0]
if not isinstance(audio_url, str):
raise ValueError(f"RunwayML TTS audio URL is not a string: {audio_url}")
# Download the audio file
from litellm.llms.custom_httpx.http_handler import _get_httpx_client
client: Final = _get_httpx_client()
audio_response: Final = client.get(url=audio_url)
audio_response.raise_for_status()
verbose_logger.debug("RunwayML TTS audio downloaded successfully")
# Return the audio data wrapped in HttpxBinaryResponseContent
return HttpxBinaryResponseContent(audio_response)
async def async_transform_text_to_speech_response(
self,
model: str,
raw_response: httpx.Response,
logging_obj: "LiteLLMLoggingObj",View on GitHub (pinned to 77b7c6c40c)
Solutions
- The audio URL field had an unexpected type; check the task output schema.
- Report the schema mismatch to the litellm issue tracker.
Example fix
# inspect the audio_url value printed in the error.
Defensive patterns
Strategy: type-guard
When it happens
Trigger: Triggered when the RunwayML TTS audio URL in the output is not a string.
Common situations: See trigger scenarios.
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/694c45b06c6943e9.
Report an issue: GitHub.