BerriAI/litellm · error · ValueError
RUNWAYML_API_SECRET or RUNWAYML_API_KEY is not set
Error message
RUNWAYML_API_SECRET or RUNWAYML_API_KEY is not set
What it means
Credential guard in the RunwayML TTS config's validate_environment: the key chain (argument, RUNWAYML_API_SECRET, RUNWAYML_API_KEY) resolved nothing, so auth headers cannot be built and the TTS request is rejected before sending.
Source
Thrown at litellm/llms/runwayml/text_to_speech/transformation.py:207
# Return None for voice string since RunwayML uses dict format
return None, mapped_params
def validate_environment(
self,
headers: dict,
model: str,
api_key: str | None = None,
api_base: str | None = None,
) -> dict:
"""
Validate RunwayML environment and set up authentication headers
"""
validated_headers: Final = headers.copy()
final_api_key: Final = api_key or get_secret_str("RUNWAYML_API_SECRET") or get_secret_str("RUNWAYML_API_KEY")
if not final_api_key:
raise ValueError("RUNWAYML_API_SECRET or RUNWAYML_API_KEY is not set")
validated_headers["Authorization"] = f"Bearer {final_api_key}"
validated_headers["X-Runway-Version"] = RUNWAYML_DEFAULT_API_VERSION
validated_headers["Content-Type"] = "application/json"
return validated_headers
def get_complete_url(
self,
model: str,
api_base: str | None,
litellm_params: dict,
) -> str:
"""
Get the complete URL for RunwayML TTS request
"""
complete_url = api_base or get_secret_str("RUNWAYML_API_BASE") or self.DEFAULT_BASE_URL
View on GitHub (pinned to 77b7c6c40c)
Solutions
- Set RUNWAYML_API_SECRET (or RUNWAYML_API_KEY) environment variable.
- Or pass api_key to the speech call.
Example fix
litellm.speech(model="runwayml/...", api_key="<key>", input=...)
Defensive patterns
Strategy: validation
When it happens
Trigger: Triggered when calling RunwayML text-to-speech without RUNWAYML_API_SECRET or RUNWAYML_API_KEY set.
Common situations: See trigger scenarios.
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/24695a84b0bfe1bf.
Report an issue: GitHub.