{"record":{"id":"2e6bd49fa559c8bc","repo":"BerriAI/litellm","slug":"runwayml-api-key-is-required-set-runwayml-api-sec","errorCode":null,"errorMessage":"RunwayML API key is required. Set RUNWAYML_API_SECRET environment variable or pass api_key parameter.","messagePattern":"RunwayML API key is required\\. Set RUNWAYML_API_SECRET environment variable or pass api_key parameter\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/runwayml/videos/transformation.py","lineNumber":158,"sourceCode":"        headers: dict,\n        model: str,\n        api_key: str | None = None,\n        litellm_params: GenericLiteLLMParams | None = None,\n    ) -> dict:\n        \"\"\"\n        Validate environment and set up authentication headers.\n        RunwayML uses Bearer token authentication via RUNWAYML_API_SECRET.\n        \"\"\"\n        # Use api_key from litellm_params if available, otherwise fall back to other sources\n        if litellm_params and litellm_params.api_key:\n            api_key = api_key or litellm_params.api_key\n\n        api_key = (\n            api_key or litellm.api_key or get_secret_str(\"RUNWAYML_API_SECRET\") or get_secret_str(\"RUNWAYML_API_KEY\")\n        )\n\n        if api_key is None:\n            raise ValueError(\n                \"RunwayML API key is required. Set RUNWAYML_API_SECRET environment variable or pass api_key parameter.\"\n            )\n\n        headers.update(\n            {\n                \"Authorization\": f\"Bearer {api_key}\",\n                \"X-Runway-Version\": RUNWAYML_DEFAULT_API_VERSION,\n                \"Content-Type\": \"application/json\",\n            }\n        )\n        return headers\n\n    def get_complete_url(\n        self,\n        model: str,\n        api_base: str | None,\n        litellm_params: dict,\n    ) -> str:","sourceCodeStart":140,"sourceCodeEnd":176,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/runwayml/videos/transformation.py#L140-L176","documentation":"Credential guard in the RunwayML videos config's validate_environment: after checking litellm_params and litellm.api_key, the RUNWAYML_API_SECRET lookup still found no key, so the Bearer header cannot be built for video API calls.","triggerScenarios":"Triggered when calling the RunwayML video API without RUNWAYML_API_SECRET set or api_key passed.","commonSituations":"See trigger scenarios.","solutions":["Set the RUNWAYML_API_SECRET environment variable.","Or pass api_key parameter to the video call."],"exampleFix":"os.environ[\"RUNWAYML_API_SECRET\"] = \"<key>\"","handlingStrategy":"validation","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"}