BerriAI/litellm · error · ValueError

RunwayML TTS response missing task ID

Error message

RunwayML TTS response missing task ID

What it means

Contract guard in the RunwayML TTS response transformation: the JSON body contains no 'id', so there is no task identifier to poll for audio completion and the transformation aborts with this error.

Solutions

  1. Inspect the raw RunwayML response; the task id field was absent.
  2. Verify API key and request body.

Example fix

# log the response body to inspect the actual payload.
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Triggered when the RunwayML TTS response does not contain a task ID.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at litellm/llms/runwayml/text_to_speech/transformation.py:469

        }
        """
        from litellm.types.llms.openai import HttpxBinaryResponseContent

        try:
            response_data: Final = raw_response.json()
        except Exception as e:
            raise self.get_error_class(
                error_message=f"Error parsing RunwayML TTS response: {e}",
                status_code=raw_response.status_code,
                headers=dict(raw_response.headers),
            )

        verbose_logger.debug("RunwayML TTS starting polling...")

        # Get task ID
        task_id: Final = response_data.get("id")
        if not task_id:
            raise ValueError("RunwayML TTS response missing task ID")

        # Get headers for polling (need auth)
        poll_headers: Final = {
            "Authorization": raw_response.request.headers.get("Authorization", ""),
            "X-Runway-Version": raw_response.request.headers.get("X-Runway-Version", RUNWAYML_DEFAULT_API_VERSION),
        }

        # Poll until task completes
        polled_response: Final = self._poll_task_sync(
            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()

View on GitHub (pinned to 77b7c6c40c)