{"record":{"id":"e125262761e7e574","repo":"BerriAI/litellm","slug":"video-extension-is-not-supported-for-gemini","errorCode":null,"errorMessage":"video extension is not supported for Gemini","messagePattern":"video extension is not supported for Gemini","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"litellm/llms/gemini/videos/transformation.py","lineNumber":593,"sourceCode":"        self,\n        raw_response,\n        logging_obj,\n        custom_llm_provider=None,\n        request_data=None,\n    ):\n        raise NotImplementedError(\"video edit is not supported for Gemini\")\n\n    def transform_video_extension_request(\n        self,\n        prompt,\n        video_id,\n        seconds,\n        api_base,\n        litellm_params,\n        headers,\n        extra_body=None,\n    ):\n        raise NotImplementedError(\"video extension is not supported for Gemini\")\n\n    def transform_video_extension_response(self, raw_response, logging_obj, custom_llm_provider=None):\n        raise NotImplementedError(\"video extension is not supported for Gemini\")\n\n    def get_error_class(self, error_message: str, status_code: int, headers: dict | httpx.Headers) -> BaseLLMException:\n        from ..common_utils import GeminiError\n\n        return GeminiError(\n            status_code=status_code,\n            message=error_message,\n            headers=headers,\n        )\n","sourceCodeStart":575,"sourceCodeEnd":606,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/gemini/videos/transformation.py#L575-L606","documentation":"transform_video_extension_request for Gemini raises NotImplementedError: Veo cannot extend an existing video by N seconds through this integration. Clip length is fixed at generation time via the durationSeconds parameter (within the model's allowed range), so 'extend later' is not an operation the provider supports.","triggerScenarios":"Calling litellm.video_extension(model='gemini/veo-3', video_id=..., seconds=4, prompt=...).","commonSituations":"Apps ported from Runway or other providers that offer extend; 'make it longer' UI affordances applied uniformly across providers.","solutions":["Plan duration up front and pass duration_seconds (mapped to durationSeconds) in the original video_generation call.","If a longer video is needed afterwards, generate a new clip with the higher durationSeconds.","Hide the extend action for Gemini-backed models."],"exampleFix":"# before\nlitellm.video_extension(\n    model=\"gemini/veo-3\", video_id=video.id, seconds=4, prompt=\"continue the scene\"\n)\n\n# after: set duration at creation time instead of extending later\nvideo = litellm.video_generation(\n    model=\"gemini/veo-3\", prompt=\"a cat surfing\", duration_seconds=8\n)","handlingStrategy":"try-catch","validationCode":"def provider_supports_video_extension(model: str) -> bool:\n    return not model.lower().startswith((\"gemini/\", \"vedo/\"))","typeGuard":"def can_extend_video(model: str) -> bool:\n    return not model.lower().startswith((\"gemini/\", \"vedo/\"))","tryCatchPattern":"try:\n    ext = litellm.video_extension(model=model, video_id=video_id, seconds=4, prompt=p)\nexcept NotImplementedError:\n    if model.startswith(\"gemini/\"):\n        ext = litellm.video_generation(model=model, prompt=p, duration_seconds=8)  # regenerate longer","preventionTips":["Decide clip duration up front and pass duration_seconds to video_generation.","Disable 'extend' controls for Gemini-backed models.","Remember Veo clips are bounded (e.g. up to 8s for Veo 3); plan shots accordingly."],"tags":["veo","gemini","video-extension","not-implemented","unsupported-operation"],"backgroundTag":"unsupported-operation","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}